Make sure banner drops, even if banner entity doesn't exist

This commit is contained in:
PrairieWind 2023-03-29 17:37:04 -06:00 committed by MrRar
parent a98f79763b
commit 088922dc33
1 changed files with 8 additions and 8 deletions

View File

@ -133,6 +133,8 @@ local function on_destruct_banner(pos, hanging)
local ent = v:get_luaentity()
if ent and ent.name == nodename then
v:remove()
end
end
-- Drop item
local meta = minetest.get_meta(pos)
local item = meta:get_inventory():get_stack("banner", 1)
@ -142,8 +144,6 @@ local function on_destruct_banner(pos, hanging)
minetest.handle_node_drops(pos, {"mcl_banners:banner_item_white"})
end
end
end
end
local function on_destruct_standing_banner(pos)
return on_destruct_banner(pos, false)