From 871323f4e16aed1ca0453030fe57cabb2d1bdcd5 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 17 May 2025 00:59:20 +1000 Subject: [PATCH] Cheats: Fix setting overrides applying for blacklisted patches --- src/core/cheats.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core/cheats.cpp b/src/core/cheats.cpp index 708b107d1..8e4f21dc0 100644 --- a/src/core/cheats.cpp +++ b/src/core/cheats.cpp @@ -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& 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& code : s_patch_codes) { if (name == code->GetName()) { - code->ApplySettingOverrides(); + if (!code->GetMetadata().disallow_for_achievements || !hc_mode_active) + code->ApplySettingOverrides(); + break; } }