Repair the mental damage with ZwinderStateManager having a method called HasState that doesn't actually tell you whether it has a state

Reverts commit 4a58ff2a0c and instead updates ZwinderStateManager to use what apparently is the correct (?) way to tell whether a state is had.
This commit is contained in:
nattthebear 2021-01-16 19:26:06 -05:00
parent c218cf302f
commit 7204eeb533
2 changed files with 3 additions and 4 deletions

View File

@ -469,7 +469,7 @@ namespace BizHawk.Client.Common
public bool HasState(int frame)
{
return StateCache.Contains(frame);
return GetStateClosestToFrame(frame).Key == frame;
}
private bool InvalidateGaps(int frame)

View File

@ -788,10 +788,10 @@ namespace BizHawk.Client.EmuHawk
{
MainForm.FrameAdvance();
byte[] greenZone = CurrentTasMovie.TasStateManager[Emulator.Frame];
if (greenZone.Length > 0)
if (CurrentTasMovie.TasStateManager.HasState(Emulator.Frame))
{
byte[] state = StatableEmulator.CloneSavestate();
byte[] greenZone = CurrentTasMovie.TasStateManager[Emulator.Frame];
if (!state.SequenceEqual(greenZone))
{
@ -805,7 +805,6 @@ namespace BizHawk.Client.EmuHawk
File.WriteAllBytes(path, greenZone);
}
}
return;
}