Disable Debug Mode in hardcore mode

Debug Mode gives players direct read and write access to memory, which could be used to completely manipulate RetroAchievements logic and therefore is not allowed in hardcore mode.
This commit is contained in:
LillyJadeKatrin
2023-06-07 21:54:49 -04:00
parent c20258d782
commit cb2fa9a1f2
11 changed files with 47 additions and 8 deletions

View File

@ -33,6 +33,7 @@
#include "Common/FileUtil.h"
#include "Common/StringUtil.h"
#include "Core/Config/AchievementSettings.h"
#include "Core/Config/GraphicsSettings.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h"
@ -563,6 +564,10 @@ void Settings::SetCheatsEnabled(bool enabled)
void Settings::SetDebugModeEnabled(bool enabled)
{
#ifdef USE_RETRO_ACHIEVEMENTS
if (Config::Get(Config::RA_HARDCORE_ENABLED))
enabled = false;
#endif // USE_RETRO_ACHIEVEMENTS
if (IsDebugModeEnabled() != enabled)
{
Config::SetBaseOrCurrent(Config::MAIN_ENABLE_DEBUGGING, enabled);