Browse Source

[lua] Fix for #1290, do not carry over time when timeScale of a track entry taht's being replaced by a new one is 0.

badlogic 6 years ago
parent
commit
2db16cc384
1 changed files with 5 additions and 1 deletions
  1. 5 1
      spine-lua/AnimationState.lua

+ 5 - 1
spine-lua/AnimationState.lua

@@ -249,7 +249,11 @@ function AnimationState:update (delta)
 					local nextTime = current.trackLast - _next.delay
 					if nextTime >= 0 then
 						_next.delay = 0
-						_next.trackTime = (nextTime / current.timeScale + delta) * _next.timeScale
+						if current.timeScale == 0 then
+							_next.trackTime = 0
+						else
+							_next.trackTime = (nextTime / current.timeScale + delta) * _next.timeScale
+						end
 						current.trackTime = current.trackTime + currentDelta
 						self:setCurrent(i, _next, true)
 						while _next.mixingFrom do