Pass test WorkWithFullUndoHistory. BeginNewBatch was not returning what it said it was.

This commit is contained in:
SuuperW 2025-07-04 14:26:22 -05:00
parent 12a59e1710
commit c1605591d1
No known key found for this signature in database
1 changed files with 2 additions and 7 deletions

View File

@ -140,7 +140,7 @@ namespace BizHawk.Client.Common
if (ret) if (ret)
{ {
ret = AddMovieAction(name); AddMovieAction(name);
} }
_recordingBatch = true; _recordingBatch = true;
@ -268,17 +268,15 @@ namespace BizHawk.Client.Common
} }
} }
private bool AddMovieAction(string name) private void AddMovieAction(string name)
{ {
if (UndoIndex + 1 != _history.Count) if (UndoIndex + 1 != _history.Count)
{ {
TruncateLog(UndoIndex + 1); TruncateLog(UndoIndex + 1);
} }
if (name.Length is 0) name = $"Undo step {_totalSteps}"; if (name.Length is 0) name = $"Undo step {_totalSteps}";
bool ret = false;
if (!_recordingBatch) if (!_recordingBatch)
{ {
ret = true;
_history.Add(new List<IMovieAction>(1)); _history.Add(new List<IMovieAction>(1));
Names.Add(name); Names.Add(name);
_totalSteps += 1; _totalSteps += 1;
@ -291,11 +289,8 @@ namespace BizHawk.Client.Common
{ {
_history.RemoveAt(0); _history.RemoveAt(0);
Names.RemoveAt(0); Names.RemoveAt(0);
ret = false;
} }
} }
return ret;
} }
// TODO: These probably aren't the best way to handle undo/redo. // TODO: These probably aren't the best way to handle undo/redo.