mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 05:43:43 +01:00
Fix using shield on unknown nodes and cleanup
This commit is contained in:
parent
d5bc0613d8
commit
084741b733
@ -269,12 +269,8 @@ local function remove_shield_entity(player, i)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function is_node_stack(itemstack)
|
|
||||||
return (itemstack:get_definition().type == "node")
|
|
||||||
end
|
|
||||||
|
|
||||||
local function is_rmb_conflicting_node(nodename)
|
local function is_rmb_conflicting_node(nodename)
|
||||||
nodedef = minetest.registered_nodes[nodename]
|
nodedef = minetest.registered_nodes[nodename] or {}
|
||||||
return nodedef.on_rightclick
|
return nodedef.on_rightclick
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -312,7 +308,7 @@ local function handle_blocking(player)
|
|||||||
local pointed_node = minetest.get_node(pointed_thing.under)
|
local pointed_node = minetest.get_node(pointed_thing.under)
|
||||||
if minetest.get_item_group(pointed_node.name, "container") > 1
|
if minetest.get_item_group(pointed_node.name, "container") > 1
|
||||||
or is_rmb_conflicting_node(pointed_node.name)
|
or is_rmb_conflicting_node(pointed_node.name)
|
||||||
or is_node_stack(wielded_stack)
|
or wielded_stack:get_definition().type == "node"
|
||||||
then
|
then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user