From 084741b733157af951bae9962ba65cffc9f6b19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikita=20Wi=C5=9Bniewski?= Date: Fri, 16 Aug 2024 10:54:21 +0700 Subject: [PATCH] Fix using shield on unknown nodes and cleanup --- mods/ITEMS/mcl_shields/init.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_shields/init.lua b/mods/ITEMS/mcl_shields/init.lua index 62904aa1d..b3323bd3f 100644 --- a/mods/ITEMS/mcl_shields/init.lua +++ b/mods/ITEMS/mcl_shields/init.lua @@ -269,12 +269,8 @@ local function remove_shield_entity(player, i) end end -local function is_node_stack(itemstack) - return (itemstack:get_definition().type == "node") -end - local function is_rmb_conflicting_node(nodename) - nodedef = minetest.registered_nodes[nodename] + nodedef = minetest.registered_nodes[nodename] or {} return nodedef.on_rightclick end @@ -312,7 +308,7 @@ local function handle_blocking(player) local pointed_node = minetest.get_node(pointed_thing.under) if minetest.get_item_group(pointed_node.name, "container") > 1 or is_rmb_conflicting_node(pointed_node.name) - or is_node_stack(wielded_stack) + or wielded_stack:get_definition().type == "node" then return end