From 088922dc33d0f6bca2369dd35d1455079399bd6a Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Wed, 29 Mar 2023 17:37:04 -0600 Subject: [PATCH] Make sure banner drops, even if banner entity doesn't exist --- mods/ITEMS/mcl_banners/init.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mods/ITEMS/mcl_banners/init.lua b/mods/ITEMS/mcl_banners/init.lua index b1e9070c6..bd71338ee 100644 --- a/mods/ITEMS/mcl_banners/init.lua +++ b/mods/ITEMS/mcl_banners/init.lua @@ -133,16 +133,16 @@ local function on_destruct_banner(pos, hanging) local ent = v:get_luaentity() if ent and ent.name == nodename then v:remove() - -- Drop item - local meta = minetest.get_meta(pos) - local item = meta:get_inventory():get_stack("banner", 1) - if not item:is_empty() then - minetest.handle_node_drops(pos, {item:to_string()}) - else - minetest.handle_node_drops(pos, {"mcl_banners:banner_item_white"}) - end end end + -- Drop item + local meta = minetest.get_meta(pos) + local item = meta:get_inventory():get_stack("banner", 1) + if not item:is_empty() then + minetest.handle_node_drops(pos, {item:to_string()}) + else + minetest.handle_node_drops(pos, {"mcl_banners:banner_item_white"}) + end end local function on_destruct_standing_banner(pos)