Skip to content

Commit

Permalink
only remove display entity after digging
Browse files Browse the repository at this point in the history
  • Loading branch information
OgelGames committed Feb 9, 2021
1 parent 40fc6ef commit 3a3b225
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down Expand Up @@ -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,
})
Expand Down

0 comments on commit 3a3b225

Please sign in to comment.