From e4e54007d0d066578a31b3c81edb19b46975cb87 Mon Sep 17 00:00:00 2001 From: SuperLlama88888 <116475184+SuperLlama88888@users.noreply.github.com> Date: Fri, 17 Jan 2025 18:56:40 +1100 Subject: [PATCH] Fix animations without end keyframe going wacky Animations using keyframes where the animation length is longer than the last keyframe will cause unexpected behaviour - notably, a continuation of the animation, whereas in-game, the animation simply halts at the last keyframe. This PR fixes it by stopping on the last keyframe after reaching it, instead of trying to interpolate to the first keyframe. --- lib/Animations/Animation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Animations/Animation.ts b/lib/Animations/Animation.ts index 2855356..74618a3 100644 --- a/lib/Animations/Animation.ts +++ b/lib/Animations/Animation.ts @@ -72,7 +72,7 @@ export class Animation { if (time > this.currentTime) { continue - } else if (time === this.currentTime) { + } else if (time === this.currentTime || i === timestamps.length - 1) { if (Array.isArray(transform)) { return transform.map((t) => typeof t === 'string' ? this.execute(t) : t