Merge pull request #25 from Ocraw/main
Check to prevent wap from opening on chests
This commit is contained in:
commit
6381cee6eb
@ -50,6 +50,16 @@ end
|
||||
|
||||
local function on_wireless_pad_secondary(itemstack, placer, pointed_thing)
|
||||
if not placer or not placer:is_player() then return end
|
||||
-- Make sure the wap doesn't open if clicking on a node with on_rightclick function
|
||||
-- unless sneak is pressed.
|
||||
if pointed_thing.type == "node" then
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
if not placer:get_player_control().sneak and node then
|
||||
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
|
||||
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local playerName = placer:get_player_name()
|
||||
local itemMeta = itemstack:get_meta()
|
||||
|
Loading…
x
Reference in New Issue
Block a user