VM: Only load patches if game is loading.

This commit is contained in:
refractionpcsx2 2022-12-28 14:42:45 +00:00
parent 483e2236ca
commit 5ee0565342
1 changed files with 9 additions and 6 deletions

View File

@ -559,14 +559,17 @@ void VMManager::LoadPatches(const std::string& serial, u32 crc, bool show_messag
if (EmuConfig.EnablePatches)
{
const GameDatabaseSchema::GameEntry* game = GameDatabase::findGame(serial);
const std::string* patches = game ? game->findPatch(crc) : nullptr;
if (patches && (patch_count = LoadPatchesFromString(*patches)) > 0)
if (game)
{
PatchesCon->WriteLn(Color_Green, "(GameDB) Patches Loaded: %d", patch_count);
fmt::format_to(std::back_inserter(message), "{} game patches", patch_count);
}
const std::string* patches = game->findPatch(crc);
if (patches && (patch_count = LoadPatchesFromString(*patches)) > 0)
{
PatchesCon->WriteLn(Color_Green, "(GameDB) Patches Loaded: %d", patch_count);
fmt::format_to(std::back_inserter(message), "{} game patches", patch_count);
}
LoadDynamicPatches(game->dynaPatches);
LoadDynamicPatches(game->dynaPatches);
}
}
// regular cheat patches