From 9c499a92f2173780b0d0173d2fc45364e689e8ee Mon Sep 17 00:00:00 2001 From: badlogic Date: Tue, 28 May 2019 14:21:00 +0200 Subject: [PATCH] [lua] Fixed queueing of events. Closes #1363. --- spine-lua/AnimationState.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spine-lua/AnimationState.lua b/spine-lua/AnimationState.lua index 10b1d28f0..59a8637a6 100644 --- a/spine-lua/AnimationState.lua +++ b/spine-lua/AnimationState.lua @@ -322,7 +322,6 @@ function AnimationState:apply (skeleton) if skeleton == nil then error("skeleton cannot be null.", 2) end if self.animationsChanged then self:_animationsChanged() end - local events = self.events local tracks = self.tracks local queue = self.queue local applied = false @@ -348,7 +347,7 @@ function AnimationState:apply (skeleton) local timelines = current.animation.timelines if (i == 0 and mix == 1) or blend == MixBlend.add then for i,timeline in ipairs(timelines) do - timeline:apply(skeleton, animationLast, animationTime, events, mix, blend, MixDirection._in) + timeline:apply(skeleton, animationLast, animationTime, self.events, mix, blend, MixDirection._in) end else local timelineMode = current.timelineMode @@ -363,13 +362,12 @@ function AnimationState:apply (skeleton) self:applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii * 2, firstFrame) else - timeline:apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, MixDirection._in) + timeline:apply(skeleton, animationLast, animationTime, self.events, mix, timelineBlend, MixDirection._in) end end end self:queueEvents(current, animationTime) self.events = {}; - events = self.events; current.nextAnimationLast = animationTime current.nextTrackLast = current.trackTime end @@ -450,13 +448,15 @@ function AnimationState:applyMixingFrom (to, skeleton, blend) if drawOrder then direction = MixDirection._in end end end - timeline:apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction) + timeline:apply(skeleton, animationLast, animationTime, self.events, alpha, timelineBlend, direction) end end end end - if (to.mixDuration > 0) then self:queueEvents(from, animationTime) end + if (to.mixDuration > 0) then + self:queueEvents(from, animationTime) + end self.events = {}; from.nextAnimationLast = animationTime from.nextTrackLast = from.trackTime