Make doors place when shift is held instead of calling on_rightclick
authorrubenwardy <rubenwardy@gmail.com>
Tue, 3 Jan 2017 16:54:01 +0000 (16:54 +0000)
committerGitHub <noreply@github.com>
Tue, 3 Jan 2017 16:54:01 +0000 (16:54 +0000)
Fixes #1364

mods/doors/init.lua

index c5d4a140a8217586df6e1acfaa381209e42c15ed..ae257fb65e13a7100b4050c70f21d092a5de68e8 100644 (file)
@@ -265,7 +265,8 @@ function doors.register(name, def)
 
                        local node = minetest.get_node(pointed_thing.under)
                        local pdef = minetest.registered_nodes[node.name]
-                       if pdef and pdef.on_rightclick then
+                       if pdef and pdef.on_rightclick and
+                                       not placer:get_player_control().sneak then
                                return pdef.on_rightclick(pointed_thing.under,
                                                node, placer, itemstack, pointed_thing)
                        end