only remove display entity after digging

fixes pandorabox-io/pandorabox.io#617
This commit is contained in:
OgelGames 2021-02-09 20:15:33 +11:00
parent 40fc6ef8cf
commit 3a3b225726

View File

@ -472,7 +472,10 @@ minetest.register_node("protector:protect", {
after_destruct = function(pos, oldnode)
local objects = minetest.get_objects_inside_radius(pos, 0.5)
for _, v in ipairs(objects) do
v:remove()
local ent = v:get_luaentity()
if ent and ent.name == "protector:display" then
v:remove()
end
end
end,
})
@ -574,7 +577,10 @@ minetest.register_node("protector:protect2", {
after_destruct = function(pos, oldnode)
local objects = minetest.get_objects_inside_radius(pos, 0.5)
for _, v in ipairs(objects) do
v:remove()
local ent = v:get_luaentity()
if ent and ent.name == "protector:display" then
v:remove()
end
end
end,
})