mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-06 19:45:33 +00:00
Cheats: Fix setting overrides applying for blacklisted patches
This commit is contained in:
parent
1547de2b3c
commit
871323f4e1
@ -946,14 +946,18 @@ void Cheats::UnloadAll()
|
|||||||
|
|
||||||
bool Cheats::HasAnySettingOverrides()
|
bool Cheats::HasAnySettingOverrides()
|
||||||
{
|
{
|
||||||
|
const bool hc_mode_active = Achievements::IsHardcoreModeActive();
|
||||||
for (const std::string& name : s_enabled_patches)
|
for (const std::string& name : s_enabled_patches)
|
||||||
{
|
{
|
||||||
for (std::unique_ptr<CheatCode>& code : s_patch_codes)
|
for (std::unique_ptr<CheatCode>& code : s_patch_codes)
|
||||||
{
|
{
|
||||||
if (name == code->GetName())
|
if (name == code->GetName())
|
||||||
{
|
{
|
||||||
if (code->HasAnySettingOverrides())
|
if (!code->GetMetadata().disallow_for_achievements || !hc_mode_active)
|
||||||
return true;
|
{
|
||||||
|
if (code->HasAnySettingOverrides())
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -966,13 +970,16 @@ bool Cheats::HasAnySettingOverrides()
|
|||||||
void Cheats::ApplySettingOverrides()
|
void Cheats::ApplySettingOverrides()
|
||||||
{
|
{
|
||||||
// only need to check patches for this
|
// only need to check patches for this
|
||||||
|
const bool hc_mode_active = Achievements::IsHardcoreModeActive();
|
||||||
for (const std::string& name : s_enabled_patches)
|
for (const std::string& name : s_enabled_patches)
|
||||||
{
|
{
|
||||||
for (std::unique_ptr<CheatCode>& code : s_patch_codes)
|
for (std::unique_ptr<CheatCode>& code : s_patch_codes)
|
||||||
{
|
{
|
||||||
if (name == code->GetName())
|
if (name == code->GetName())
|
||||||
{
|
{
|
||||||
code->ApplySettingOverrides();
|
if (!code->GetMetadata().disallow_for_achievements || !hc_mode_active)
|
||||||
|
code->ApplySettingOverrides();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user