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

This reverts commit 7204eeb533.
This commit is contained in:
adelikat 2021-01-16 18:48:19 -06:00
parent 7204eeb533
commit 187cf46670
2 changed files with 4 additions and 3 deletions

View File

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

View File

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