Merge pull request #10756 from AdmiralCurtiss/qt-memcard-change-hotfix

Qt/GameCubePane: Fix swapping memory cards mid-emulation.
This commit is contained in:
Admiral H. Curtiss 2022-06-15 15:04:41 +02:00 committed by GitHub
commit f73b14bb01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -372,6 +372,7 @@ void GameCubePane::BrowseMemcard(ExpansionInterface::Slot slot)
} }
} }
const std::string old_eu_path = Config::GetMemcardPath(slot, DiscIO::Region::PAL);
Config::SetBase(Config::GetInfoForMemcardPath(slot), raw_path); Config::SetBase(Config::GetInfoForMemcardPath(slot), raw_path);
if (Core::IsRunning()) if (Core::IsRunning())
@ -379,7 +380,6 @@ void GameCubePane::BrowseMemcard(ExpansionInterface::Slot slot)
// If emulation is running and the new card is different from the old one, notify the system to // If emulation is running and the new card is different from the old one, notify the system to
// eject the old and insert the new card. // eject the old and insert the new card.
// TODO: This should probably done by a config change callback instead. // TODO: This should probably done by a config change callback instead.
const std::string old_eu_path = Config::GetMemcardPath(slot, DiscIO::Region::PAL);
if (eu_path != old_eu_path) if (eu_path != old_eu_path)
{ {
// ChangeDevice unplugs the device for 1 second, which means that games should notice that // ChangeDevice unplugs the device for 1 second, which means that games should notice that