aboutsummaryrefslogtreecommitdiff
path: root/builtin/item.lua
diff options
context:
space:
mode:
authorPilzAdam <PilzAdam@gmx.de>2013-01-27 21:58:46 +0100
committerPilzAdam <PilzAdam@gmx.de>2013-01-27 21:58:46 +0100
commit28f5b55643080e07a89af5a2e21ffadf3781be19 (patch)
tree9d55264894e567ffadc34e9e42d45fc820faeb17 /builtin/item.lua
parentc1fee78e85f52e3b5c18bf2b2f56bc6926597868 (diff)
downloadminetest-28f5b55643080e07a89af5a2e21ffadf3781be19.tar.gz
minetest-28f5b55643080e07a89af5a2e21ffadf3781be19.tar.bz2
minetest-28f5b55643080e07a89af5a2e21ffadf3781be19.zip
Dont call on_rightclick() if sneak is pressed
Diffstat (limited to 'builtin/item.lua')
-rw-r--r--builtin/item.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/item.lua b/builtin/item.lua
index d36e8a758..a28798d4d 100644
--- a/builtin/item.lua
+++ b/builtin/item.lua
@@ -232,7 +232,8 @@ end
function minetest.item_place(itemstack, placer, pointed_thing)
-- Call on_rightclick if the pointed node defines it
- if pointed_thing.type == "node" then
+ if pointed_thing.type == "node" and placer and
+ not placer:get_player_control().sneak then
local n = minetest.env:get_node(pointed_thing.under)
local nn = n.name
if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].on_rightclick then