Skip to content

Commit 42f52d0

Browse files
committed
Fix failure states in find_marker_on_or_before
1 parent 456fbf3 commit 42f52d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/TAStudioLuaLibrary.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,12 @@ public void LoadBranch(int index)
490490
[LuaMethod(
491491
name: "find_marker_on_or_before",
492492
description: "Returns the frame number of the marker closest to the given frame (including that frame, but not after it)."
493-
+ " This may be the power-on marker at 0."
493+
+ " This may be the power-on marker at 0. Returns -1 if the arguments are invalid or TAStudio isn't active."
494494
+ " If branchID is specified, searches the markers in that branch instead.")]
495495
public int FindMarkerOnOrBefore(int frame, string/*?*/ branchID = null)
496496
=> Engaged() && MarkerListForBranch(branchID) is TasMovieMarkerList markers
497-
? markers.PreviousOrCurrent(frame).Frame
498-
: default;
497+
? markers.PreviousOrCurrent(frame)?.Frame ?? -1
498+
: -1;
499499

500500
[LuaMethodExample("""
501501
local marker_label = tastudio.getmarker(tastudio.get_frames_with_markers()[2]);

0 commit comments

Comments
 (0)