Prevent hangs from trying to go backwards w/ client.seekframe

This commit is contained in:
YoshiRulz 2021-05-03 16:39:23 +10:00
parent 8b79720b9d
commit 5016f6ef1c
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 7 additions and 0 deletions

View File

@ -88,6 +88,13 @@ namespace BizHawk.Client.Common
[LuaMethod("seekframe", "Makes the emulator seek to the frame specified")]
public void SeekFrame(int frame)
{
if (frame < Emulator.Frame)
{
Log("client.seekframe: cannot seek backwards");
return;
}
if (frame == Emulator.Frame) return;
bool wasPaused = MainForm.EmulatorPaused;
// can't re-enter lua while doing this