Guard against cheat codes in RetroAchievements' hardcore mode
originally I thought just blocking the cheat window would be enough, but autoloaded cheat codes could sneak through. An actual check for cheat codes being active prevents this being an issue.
This commit is contained in:
parent
beab2b141b
commit
02acd542c2
|
@ -15,6 +15,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
GameInfo Game { get; }
|
GameInfo Game { get; }
|
||||||
|
|
||||||
|
public CheatCollection CheatList { get; }
|
||||||
|
|
||||||
IMovieSession MovieSession { get; }
|
IMovieSession MovieSession { get; }
|
||||||
|
|
||||||
FirmwareManager FirmwareManager { get; }
|
FirmwareManager FirmwareManager { get; }
|
||||||
|
|
|
@ -77,6 +77,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CheatList.AnyActive)
|
||||||
|
{
|
||||||
|
HandleHardcoreModeDisable("Using cheat codes while in hardcore mode is not allowed.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// suppress rewind and frame advance hotkeys
|
// suppress rewind and frame advance hotkeys
|
||||||
_hardcoreHotkeyOverrides.FrameTick();
|
_hardcoreHotkeyOverrides.FrameTick();
|
||||||
_hardcoreHotkeyOverrides.SetButton("Frame Advance", false);
|
_hardcoreHotkeyOverrides.SetButton("Frame Advance", false);
|
||||||
|
|
|
@ -22,6 +22,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
protected IMemoryDomains Domains => Emu.AsMemoryDomains();
|
protected IMemoryDomains Domains => Emu.AsMemoryDomains();
|
||||||
protected IGameInfo Game => _mainForm.Game;
|
protected IGameInfo Game => _mainForm.Game;
|
||||||
protected IMovieSession MovieSession => _mainForm.MovieSession;
|
protected IMovieSession MovieSession => _mainForm.MovieSession;
|
||||||
|
protected CheatCollection CheatList => _mainForm.CheatList;
|
||||||
|
|
||||||
protected IReadOnlyList<MemFunctions> _memFunctions;
|
protected IReadOnlyList<MemFunctions> _memFunctions;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue