diff options
author | Aaron Suen <warr1024@gmail.com> | 2019-10-13 09:32:39 -0400 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2019-10-13 17:11:00 +0200 |
commit | 0df646e0689b5324c7bdb13205c2a63e42ebe8e8 (patch) | |
tree | f68dfef27e4e064a70939be7176eb2342dd7de96 /builtin | |
parent | 47d07793654c1bdd92afbcb486e1ff1429f29a8f (diff) | |
download | minetest-0df646e0689b5324c7bdb13205c2a63e42ebe8e8.tar.gz minetest-0df646e0689b5324c7bdb13205c2a63e42ebe8e8.tar.bz2 minetest-0df646e0689b5324c7bdb13205c2a63e42ebe8e8.zip |
Fix rotate_node to return the correct itemstack.
All on_* hooks that return an itemstack are NOT guaranteed to
modify and return the original stack. We cannot count on the
behavior of the existing builtin definitions not to be overridden
by game/mod logic.
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/common/misc_helpers.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/common/misc_helpers.lua b/builtin/common/misc_helpers.lua index d6673a691..88a498927 100644 --- a/builtin/common/misc_helpers.lua +++ b/builtin/common/misc_helpers.lua @@ -428,10 +428,9 @@ if INIT == "game" then core.rotate_node = function(itemstack, placer, pointed_thing) local name = placer and placer:get_player_name() or "" local invert_wall = placer and placer:get_player_control().sneak or false - core.rotate_and_place(itemstack, placer, pointed_thing, + return core.rotate_and_place(itemstack, placer, pointed_thing, is_creative(name), {invert_wall = invert_wall}, true) - return itemstack end end |