From 3a3b225726392addf166b5ade0f635c5cfa2296e Mon Sep 17 00:00:00 2001 From: OgelGames Date: Tue, 9 Feb 2021 20:15:33 +1100 Subject: [PATCH] only remove display entity after digging fixes pandorabox-io/pandorabox.io#617 --- init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 294467b..dd77c71 100644 --- a/init.lua +++ b/init.lua @@ -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, })