From ea4f3a926c4516e4af3d049457fc79da4040c493 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 13 Sep 2020 16:58:42 +0200 Subject: [PATCH] fix: various fix for zSortItem --- sonic-radiance.love/core/modules/world/world3D.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sonic-radiance.love/core/modules/world/world3D.lua b/sonic-radiance.love/core/modules/world/world3D.lua index 58b364c..555f4a9 100644 --- a/sonic-radiance.love/core/modules/world/world3D.lua +++ b/sonic-radiance.love/core/modules/world/world3D.lua @@ -202,6 +202,7 @@ function World3D:zSortItems(items) end local _, aY, aZ, _, aH, aD = self.bodies:getCube(itemA.mainHitbox) + local aDepth, aID, aType aDepth = itemA.depth aID = itemA.creationID aType = itemA.type @@ -210,6 +211,7 @@ function World3D:zSortItems(items) for _, itemB in ipairs(overlapping) do local _, bY, bZ, _, bH, bD = self.bodies:getCube(itemB.mainHitbox) + local bDepth, bID, bType bDepth = itemB.depth bID = itemB.creationID bType = itemB.type @@ -246,7 +248,7 @@ function World3D:zSortItems(items) elseif aID < bID then graph:add(itemB, itemA) else - err("two object can't have the same ID") + error("two object can't have the same ID") end end end