Fix off-by-one in edge cases for `tastudio.ongreenzoneinvalidated`
fixes ad07eb857
also updated the docs to match the actual behaviour
This commit is contained in:
parent
1260ecd01a
commit
51b64f63f1
|
@ -32,7 +32,7 @@ namespace BizHawk.Client.Common
|
|||
if (this.IsRecording())
|
||||
{
|
||||
TasStateManager.InvalidateAfter(frame);
|
||||
GreenzoneInvalidated(frame + 1);
|
||||
GreenzoneInvalidated(frame);
|
||||
}
|
||||
|
||||
if (frame != 0)
|
||||
|
|
|
@ -135,7 +135,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
var anyLagInvalidated = LagLog.RemoveFrom(frame);
|
||||
var anyStateInvalidated = TasStateManager.InvalidateAfter(frame);
|
||||
GreenzoneInvalidated(frame + 1);
|
||||
GreenzoneInvalidated(frame);
|
||||
if (anyLagInvalidated || anyStateInvalidated)
|
||||
{
|
||||
Changes = true;
|
||||
|
|
|
@ -543,7 +543,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
[LuaMethodExample("tastudio.ongreenzoneinvalidated( function( currentindex )\r\n\tconsole.log( \"Called whenever the greenzone is invalidated.\" );\r\nend );")]
|
||||
[LuaMethod("ongreenzoneinvalidated", "Called whenever the greenzone is invalidated. Your callback can have 1 parameter, which will be the index of the first row that was invalidated.")]
|
||||
[LuaMethod("ongreenzoneinvalidated", "Called whenever the greenzone is invalidated. Your callback can have 1 parameter, which will be the index of the last row before the invalidated ones.")]
|
||||
public void OnGreenzoneInvalidated(LuaFunction luaf)
|
||||
{
|
||||
if (Engaged())
|
||||
|
|
Loading…
Reference in New Issue