fix: various fix for zSortItem
This commit is contained in:
parent
250d75ee77
commit
ea4f3a926c
1 changed files with 3 additions and 1 deletions
|
@ -202,6 +202,7 @@ function World3D:zSortItems(items)
|
||||||
end
|
end
|
||||||
|
|
||||||
local _, aY, aZ, _, aH, aD = self.bodies:getCube(itemA.mainHitbox)
|
local _, aY, aZ, _, aH, aD = self.bodies:getCube(itemA.mainHitbox)
|
||||||
|
local aDepth, aID, aType
|
||||||
aDepth = itemA.depth
|
aDepth = itemA.depth
|
||||||
aID = itemA.creationID
|
aID = itemA.creationID
|
||||||
aType = itemA.type
|
aType = itemA.type
|
||||||
|
@ -210,6 +211,7 @@ function World3D:zSortItems(items)
|
||||||
|
|
||||||
for _, itemB in ipairs(overlapping) do
|
for _, itemB in ipairs(overlapping) do
|
||||||
local _, bY, bZ, _, bH, bD = self.bodies:getCube(itemB.mainHitbox)
|
local _, bY, bZ, _, bH, bD = self.bodies:getCube(itemB.mainHitbox)
|
||||||
|
local bDepth, bID, bType
|
||||||
bDepth = itemB.depth
|
bDepth = itemB.depth
|
||||||
bID = itemB.creationID
|
bID = itemB.creationID
|
||||||
bType = itemB.type
|
bType = itemB.type
|
||||||
|
@ -246,7 +248,7 @@ function World3D:zSortItems(items)
|
||||||
elseif aID < bID then
|
elseif aID < bID then
|
||||||
graph:add(itemB, itemA)
|
graph:add(itemB, itemA)
|
||||||
else
|
else
|
||||||
err("two object can't have the same ID")
|
error("two object can't have the same ID")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue