1
0
mirror of https://github.com/minetest-mods/3d_armor.git synced 2024-12-27 03:00:40 +01:00

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 objects = minetest.get_objects_inside_radius(pos, 1) or {}
for _, obj in pairs(objects) do
local ent = obj:get_luaentity()
if ent then
if ent.name == "3d_armor_stand:armor_entity" then
-- Remove duplicates
if object then
obj:remove()
else
object = obj
if vector.equals(obj:getpos(), pos) then
local ent = obj:get_luaentity()
if ent then
if ent.name == "3d_armor_stand:armor_entity" then
-- Remove duplicates
if object then
obj:remove()
else
object = obj
end
end
end
end