瀏覽代碼

[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 年之前
父節點
當前提交
2db16cc384
共有 1 個文件被更改,包括 5 次插入1 次删除
  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
 					local nextTime = current.trackLast - _next.delay
 					if nextTime >= 0 then
 					if nextTime >= 0 then
 						_next.delay = 0
 						_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
 						current.trackTime = current.trackTime + currentDelta
 						self:setCurrent(i, _next, true)
 						self:setCurrent(i, _next, true)
 						while _next.mixingFrom do
 						while _next.mixingFrom do