# HG changeset patch # User Sam # Date 1694448925 -25200 # Node ID 5a301dbdfbc1c3cfe568539aac5531a2abde2995 # Parent 4ba8e610b9e8fd9322cd218258969925a43d381d fix: animation time can overflow, clip it now diff -r 4ba8e610b9e8 -r 5a301dbdfbc1 src/semicongine/animation.nim --- a/src/semicongine/animation.nim Mon Sep 11 21:58:01 2023 +0700 +++ b/src/semicongine/animation.nim Mon Sep 11 23:15:25 2023 +0700 @@ -152,4 +152,4 @@ player.currentDirection = -player.currentDirection player.currentTime += float32(player.currentDirection) * dt * 2'f32 - player.currentValue = valueAt(player.animation, abs(player.currentTime) / player.animation.duration) + player.currentValue = valueAt(player.animation, (abs(player.currentTime) / player.animation.duration) mod high(AnimationTime))