Fix: Using tastudio.setplayback to seek to a non-existent marker would permanently suppress Lua.
Fix: Using tastudio.setplayback with a Lua number that happens to not currently be represented as an integer would throw.
This commit is contained in:
parent
2749b1b675
commit
88cf00d4b6
|
@ -143,30 +143,30 @@ namespace BizHawk.Client.EmuHawk
|
|||
throw new InvalidOperationException("tastudio.setplayback() is not allowed during input/memory callbacks");
|
||||
}
|
||||
|
||||
_luaLibsImpl.IsUpdateSupressed = true;
|
||||
|
||||
int f;
|
||||
if (frame is long frameNumber)
|
||||
{
|
||||
f = (int)frameNumber;
|
||||
}
|
||||
else if (frame is double frameNumber2)
|
||||
{
|
||||
f = (int)frameNumber2;
|
||||
}
|
||||
else
|
||||
{
|
||||
f = Tastudio.CurrentTasMovie.Markers.FindIndex((string)frame);
|
||||
if (f == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int markerIndex = Tastudio.CurrentTasMovie.Markers.FindIndex((string)frame);
|
||||
if (markerIndex == -1) return;
|
||||
|
||||
f = Tastudio.CurrentTasMovie.Markers[f].Frame;
|
||||
f = Tastudio.CurrentTasMovie.Markers[markerIndex].Frame;
|
||||
}
|
||||
|
||||
if (f >= 0)
|
||||
{
|
||||
_luaLibsImpl.IsUpdateSupressed = true;
|
||||
Tastudio.GoToFrame(f);
|
||||
_luaLibsImpl.IsUpdateSupressed = false;
|
||||
}
|
||||
|
||||
_luaLibsImpl.IsUpdateSupressed = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue