Fix disappearing entities when placing stands next to each other

This commit is contained in:
stujones11 2016-04-10 20:17:50 +01:00
parent b6a44057a6
commit 9de8cc12bb

View File

@ -21,14 +21,16 @@ local function update_entity(pos)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
local objects = minetest.get_objects_inside_radius(pos, 1) or {} local objects = minetest.get_objects_inside_radius(pos, 1) or {}
for _, obj in pairs(objects) do for _, obj in pairs(objects) do
local ent = obj:get_luaentity() if vector.equals(obj:getpos(), pos) then
if ent then local ent = obj:get_luaentity()
if ent.name == "3d_armor_stand:armor_entity" then if ent then
-- Remove duplicates if ent.name == "3d_armor_stand:armor_entity" then
if object then -- Remove duplicates
obj:remove() if object then
else obj:remove()
object = obj else
object = obj
end
end end
end end
end end