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

This commit is contained in:
badlogic 2018-01-12 11:13:22 +01:00
parent f56937c042
commit b5e5d4aabb

View File

@ -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