Cheats: Fix setting overrides applying for blacklisted patches

This commit is contained in:
Stenzek 2025-05-17 00:59:20 +10:00
parent 1547de2b3c
commit 871323f4e1
No known key found for this signature in database

View File

@ -946,14 +946,18 @@ void Cheats::UnloadAll()
bool Cheats::HasAnySettingOverrides()
{
const bool hc_mode_active = Achievements::IsHardcoreModeActive();
for (const std::string& name : s_enabled_patches)
{
for (std::unique_ptr<CheatCode>& code : s_patch_codes)
{
if (name == code->GetName())
{
if (code->HasAnySettingOverrides())
return true;
if (!code->GetMetadata().disallow_for_achievements || !hc_mode_active)
{
if (code->HasAnySettingOverrides())
return true;
}
break;
}
@ -966,13 +970,16 @@ bool Cheats::HasAnySettingOverrides()
void Cheats::ApplySettingOverrides()
{
// only need to check patches for this
const bool hc_mode_active = Achievements::IsHardcoreModeActive();
for (const std::string& name : s_enabled_patches)
{
for (std::unique_ptr<CheatCode>& code : s_patch_codes)
{
if (name == code->GetName())
{
code->ApplySettingOverrides();
if (!code->GetMetadata().disallow_for_achievements || !hc_mode_active)
code->ApplySettingOverrides();
break;
}
}