# HG changeset patch # User Sam # Date 1694448925 -25200 # Node ID da0375455adb7a283434ca1085671e272abbfac6 # Parent 1c40de824c39a4ba9234805f27fc3c7909302048 fix: animation time can overflow, clip it now diff -r 1c40de824c39 -r da0375455adb 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))