From e93e9e77c4bb5da37267cec0fb590fa87814e5da Mon Sep 17 00:00:00 2001 From: badlogic Date: Thu, 20 Oct 2016 14:37:24 +0200 Subject: [PATCH 1/2] [lua] Closes #739, bug in Skeleton:getBounds, need to nil check attachment --- spine-lua/Skeleton.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-lua/Skeleton.lua b/spine-lua/Skeleton.lua index 2b43fe873..49c813136 100644 --- a/spine-lua/Skeleton.lua +++ b/spine-lua/Skeleton.lua @@ -439,7 +439,7 @@ function Skeleton:getBounds(offset, size) for i, slot in ipairs(drawOrder) do local vertices = nil local attachment = slot.attachment - if attachment.type == AttachmentType.region or attachment.type == AttachmentType.mesh then + if attachment and (attachment.type == AttachmentType.region or attachment.type == AttachmentType.mesh) then vertices = attachment:updateWorldVertices(slot, false); end if vertices then From 6eb86fd3a176c6b3e86d196e17abcf670c695cfa Mon Sep 17 00:00:00 2001 From: badlogic Date: Thu, 20 Oct 2016 14:38:13 +0200 Subject: [PATCH 2/2] [lua] Closes #739, forgot math_min/max assignemnts --- spine-lua/Skeleton.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spine-lua/Skeleton.lua b/spine-lua/Skeleton.lua index 49c813136..02da47e76 100644 --- a/spine-lua/Skeleton.lua +++ b/spine-lua/Skeleton.lua @@ -40,6 +40,8 @@ local Color = require "spine-lua.Color" local setmetatable = setmetatable local ipairs = ipairs local table_insert = table.insert +local math_min = math.min +local math_max = math.max local Skeleton = {} Skeleton.__index = Skeleton