Skip to content

Commit 6186da2

Browse files
committed
Fix: CheatList was getting forcibly autosaved, after the method that properly checks the autosave config option.
1 parent a0c3d25 commit 6186da2

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

src/BizHawk.Client.Common/tools/CheatList.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,10 @@ public bool AttemptToLoadCheatFile(IMemoryDomains domains)
8888
return file.Exists && Load(domains, file.FullName, false);
8989
}
9090

91-
public void NewList(string defaultFileName, bool autosave = false)
91+
public void NewList(string defaultFileName)
9292
{
9393
_defaultFileName = defaultFileName;
9494

95-
if (autosave && _changes && _cheatList.Count is not 0)
96-
{
97-
if (string.IsNullOrEmpty(CurrentFileName))
98-
{
99-
CurrentFileName = _defaultFileName;
100-
}
101-
102-
Save();
103-
}
104-
10595
_cheatList.Clear();
10696
CurrentFileName = "";
10797
Changes = false;

src/BizHawk.Client.EmuHawk/MainForm.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3803,7 +3803,7 @@ private bool LoadRomInternal(string path, LoadRomArgs args, out bool failureIsFr
38033803

38043804
if (previousRom != CurrentlyOpenRom)
38053805
{
3806-
CheatList.NewList(Tools.GenerateDefaultCheatFilename(), autosave: true);
3806+
CheatList.NewList(Tools.GenerateDefaultCheatFilename());
38073807
if (Config.Cheats.LoadFileByGame && Emulator.HasMemoryDomains())
38083808
{
38093809
if (CheatList.AttemptToLoadCheatFile(Emulator.AsMemoryDomains()))
@@ -3820,7 +3820,7 @@ private bool LoadRomInternal(string path, LoadRomArgs args, out bool failureIsFr
38203820
}
38213821
else
38223822
{
3823-
CheatList.NewList(Tools.GenerateDefaultCheatFilename(), autosave: true);
3823+
CheatList.NewList(Tools.GenerateDefaultCheatFilename());
38243824
}
38253825
}
38263826

@@ -3857,7 +3857,7 @@ private bool LoadRomInternal(string path, LoadRomArgs args, out bool failureIsFr
38573857
DisplayManager.UpdateGlobals(Config, Emulator);
38583858
DisplayManager.Blank();
38593859
ExtToolManager.BuildToolStrip();
3860-
CheatList.NewList("", autosave: true);
3860+
CheatList.NewList("");
38613861
OnRomChanged();
38623862
return false;
38633863
}
@@ -4017,7 +4017,7 @@ public void LoadNullRom(bool clearSram = false)
40174017
PauseOnFrame = null;
40184018
CurrentlyOpenRom = null;
40194019
CurrentlyOpenRomArgs = null;
4020-
CheatList.NewList("", autosave: true);
4020+
CheatList.NewList("");
40214021
OnRomChanged();
40224022
}
40234023
}

0 commit comments

Comments
 (0)