aboutsummaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2018-03-29 21:44:13 +0200
committerSmallJoker <mk939@ymail.com>2018-06-03 17:32:00 +0200
commitfe41725e5027e90787f18088be82839760cccbb5 (patch)
treebca04b46d4e17759fd9757e5a06244e1d5ad94d3 /builtin/game
parent5624cf750f0c9de872dfff51eefd86575fa9c764 (diff)
downloadminetest-fe41725e5027e90787f18088be82839760cccbb5.tar.gz
minetest-fe41725e5027e90787f18088be82839760cccbb5.tar.bz2
minetest-fe41725e5027e90787f18088be82839760cccbb5.zip
core.rotate_node: Do not trigger after_place_node (#6900)
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/item.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/game/item.lua b/builtin/game/item.lua
index d4ce6002f..ea9681ae2 100644
--- a/builtin/game/item.lua
+++ b/builtin/game/item.lua
@@ -261,7 +261,8 @@ local function make_log(name)
return name ~= "" and core.log or function() end
end
-function core.item_place_node(itemstack, placer, pointed_thing, param2)
+function core.item_place_node(itemstack, placer, pointed_thing, param2,
+ prevent_after_place)
local def = itemstack:get_definition()
if def.type ~= "node" or pointed_thing.type ~= "node" then
return itemstack, false
@@ -375,7 +376,7 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2)
local take_item = true
-- Run callback
- if def.after_place_node then
+ if def.after_place_node and not prevent_after_place then
-- Deepcopy place_to and pointed_thing because callback can modify it
local place_to_copy = {x=place_to.x, y=place_to.y, z=place_to.z}
local pointed_thing_copy = copy_pointed_thing(pointed_thing)