Skip to content

Commit e2ede3d

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

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
@@ -3821,7 +3821,7 @@ private bool LoadRomInternal(string path, LoadRomArgs args, out bool failureIsFr
38213821

38223822
if (previousRom != CurrentlyOpenRom)
38233823
{
3824-
CheatList.NewList(Tools.GenerateDefaultCheatFilename(), autosave: true);
3824+
CheatList.NewList(Tools.GenerateDefaultCheatFilename());
38253825
if (Config.Cheats.LoadFileByGame && Emulator.HasMemoryDomains())
38263826
{
38273827
if (CheatList.AttemptToLoadCheatFile(Emulator.AsMemoryDomains()))
@@ -3838,7 +3838,7 @@ private bool LoadRomInternal(string path, LoadRomArgs args, out bool failureIsFr
38383838
}
38393839
else
38403840
{
3841-
CheatList.NewList(Tools.GenerateDefaultCheatFilename(), autosave: true);
3841+
CheatList.NewList(Tools.GenerateDefaultCheatFilename());
38423842
}
38433843
}
38443844

@@ -3875,7 +3875,7 @@ private bool LoadRomInternal(string path, LoadRomArgs args, out bool failureIsFr
38753875
DisplayManager.UpdateGlobals(Config, Emulator);
38763876
DisplayManager.Blank();
38773877
ExtToolManager.BuildToolStrip();
3878-
CheatList.NewList("", autosave: true);
3878+
CheatList.NewList("");
38793879
OnRomChanged();
38803880
return false;
38813881
}
@@ -4035,7 +4035,7 @@ public void LoadNullRom(bool clearSram = false)
40354035
PauseOnFrame = null;
40364036
CurrentlyOpenRom = null;
40374037
CurrentlyOpenRomArgs = null;
4038-
CheatList.NewList("", autosave: true);
4038+
CheatList.NewList("");
40394039
OnRomChanged();
40404040
}
40414041
}

0 commit comments

Comments
 (0)