Disable cheats in hardcore mode

RetroAchievements does not allow cheats such as Action Replay or Gecko in hardcore mode, for fairness.
This commit is contained in:
LillyJadeKatrin
2023-06-07 21:53:38 -04:00
parent 0abfa94bc8
commit 3aebbbb3e7
17 changed files with 105 additions and 9 deletions

View File

@@ -71,7 +71,7 @@ void SetActiveCodes(std::span<const GeckoCode> gcodes)
std::lock_guard lk(s_active_codes_lock);
s_active_codes.clear();
if (Config::Get(Config::MAIN_ENABLE_CHEATS))
if (Config::AreCheatsEnabled())
{
s_active_codes.reserve(gcodes.size());
std::copy_if(gcodes.begin(), gcodes.end(), std::back_inserter(s_active_codes),
@@ -103,7 +103,7 @@ std::vector<GeckoCode> SetAndReturnActiveCodes(std::span<const GeckoCode> gcodes
std::lock_guard lk(s_active_codes_lock);
s_active_codes.clear();
if (Config::Get(Config::MAIN_ENABLE_CHEATS))
if (Config::AreCheatsEnabled())
{
s_active_codes.reserve(gcodes.size());
std::copy_if(gcodes.begin(), gcodes.end(), std::back_inserter(s_active_codes),
@@ -238,7 +238,7 @@ void Shutdown()
void RunCodeHandler(const Core::CPUThreadGuard& guard)
{
if (!Config::Get(Config::MAIN_ENABLE_CHEATS))
if (!Config::AreCheatsEnabled())
return;
// NOTE: Need to release the lock because of GUI deadlocks with PanicAlert in HostWrite_*