瀏覽代碼

[lua] Closes #751, didn't clear self->events in AnimationState:queueEvents

badlogic 9 年之前
父節點
當前提交
340cc6a85b
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      spine-lua/AnimationState.lua

+ 4 - 3
spine-lua/AnimationState.lua

@@ -391,9 +391,10 @@ function AnimationState:applyRotateTimeline (timeline, skeleton, time, alpha, se
 
   local rotateTimeline = timeline
   local frames = rotateTimeline.frames
-  if time < frames[0] then return end -- Time is before first frame.
-
   local bone = skeleton.bones[rotateTimeline.boneIndex]
+  if time < frames[0] then
+		return
+	end
 
   local r2 = 0
   if time >= frames[zlen(frames) - Animation.RotateTimeline.ENTRIES] then -- Time is after last frame.
@@ -491,7 +492,7 @@ function AnimationState:queueEvents (entry, animationTime)
     end
     i = i + 1
   end
-  events = {}
+	self.events = {}
 end
 
 function AnimationState:clearTracks ()