From 3a0ba4a70a61c51d1ead547ebbe212eaad91b40a Mon Sep 17 00:00:00 2001 From: Matias Date: Thu, 13 Jun 2013 15:39:15 +0300 Subject: [PATCH] if there is no attachment, remove it also.. --- spine-lua/Animation.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spine-lua/Animation.lua b/spine-lua/Animation.lua index 6c575ff96..47dfdceae 100644 --- a/spine-lua/Animation.lua +++ b/spine-lua/Animation.lua @@ -415,14 +415,14 @@ function Animation.AttachmentTimeline.new () local attachmentName = self.attachmentNames[frameIndex] local slot = skeleton.slotsByName[self.slotName] if attachmentName then - if not slot.attachment then - slot:setAttachment(skeleton:getAttachment(self.slotName, attachmentName)) - elseif slot.attachment.name ~= attachmentName then - slot:setAttachment(skeleton:getAttachment(self.slotName, attachmentName)) - end + if not slot.attachment then + slot:setAttachment(skeleton:getAttachment(self.slotName, attachmentName)) + elseif slot.attachment.name ~= attachmentName then + slot:setAttachment(skeleton:getAttachment(self.slotName, attachmentName)) + end + else + slot:setAttachment(nil) end - - end return self