diff --git a/flixel/system/replay/FlxReplay.hx b/flixel/system/replay/FlxReplay.hx index 510fcaf5e0..013092f684 100644 --- a/flixel/system/replay/FlxReplay.hx +++ b/flixel/system/replay/FlxReplay.hx @@ -24,6 +24,7 @@ class FlxReplay /** * The number of frames in this recording. + * **Note:** This doesn't include empty records, unlike `getDuration()` */ public var frameCount:Int; @@ -243,13 +244,18 @@ class FlxReplay } /** - * Returns the last recorded frame index. **Note:** this is different from `frameCount`, which + * The duration of this replay, in frames. **Note:** this is different from `frameCount`, which * is the number of unique records, which doesn't count frames with no input + * + * @since 5.9.0 */ public function getDuration() { if (_frames != null) + { + // Add 1 to the last frame index, because they are zero-based return _frames[_frames.length - 1].frame + 1; + } return 0; }