Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Warr1024 authored and sfan5 committed Oct 13, 2019
1 parent 47d0779 commit 0df646e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions builtin/common/misc_helpers.lua
Expand Up @@ -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

Expand Down

0 comments on commit 0df646e

Please sign in to comment.