Quellcode durchsuchen

[lua] Fix for #1064, delay was calculated incorrectly for non-loop previous track entries.

badlogic vor 7 Jahren
Ursprung
Commit
b5e5d4aabb
1 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen
  1. 6 1
      spine-lua/AnimationState.lua

+ 6 - 1
spine-lua/AnimationState.lua

@@ -720,7 +720,12 @@ function AnimationState:addAnimation (trackIndex, animation, loop, delay)
     if delay <= 0 then
       local duration = last.animationEnd - last.animationStart
       if duration ~= 0 then
-        delay = delay + duration * (1 + math_floor(last.trackTime / duration)) - data:getMix(last.animation, animation)
+				if last.loop then
+					delay = delay + duration * (1 + math_floor(last.trackTime / duration))
+				else
+					delay = delay + duration
+				end
+        delay = delay - data:getMix(last.animation, animation)
       else
         delay = 0
       end