Allow to place doors at usable nodes with sneak-click

This commit is contained in:
Wuzzy 2017-03-30 04:25:16 +02:00
parent 63e25b4e09
commit 4bb1fad63d
1 changed files with 2 additions and 1 deletions

View File

@ -81,7 +81,8 @@ function mcl_doors:register_door(name, def)
end
local ptu = pointed_thing.under
local nu = minetest.get_node(ptu)
if minetest.registered_nodes[nu.name].on_rightclick then
-- Pointed thing's rightclick action takes precedence, unless player holds down the sneak key
if minetest.registered_nodes[nu.name].on_rightclick and not placer:get_player_control().sneak then
return minetest.registered_nodes[nu.name].on_rightclick(ptu, nu, placer, itemstack)
end