Skip to content

Commit 0df646e

Browse files
Warr1024sfan5
authored andcommittedOct 13, 2019
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.
1 parent 47d0779 commit 0df646e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

Diff for: ‎builtin/common/misc_helpers.lua

+1-2
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,9 @@ if INIT == "game" then
428428
core.rotate_node = function(itemstack, placer, pointed_thing)
429429
local name = placer and placer:get_player_name() or ""
430430
local invert_wall = placer and placer:get_player_control().sneak or false
431-
core.rotate_and_place(itemstack, placer, pointed_thing,
431+
return core.rotate_and_place(itemstack, placer, pointed_thing,
432432
is_creative(name),
433433
{invert_wall = invert_wall}, true)
434-
return itemstack
435434
end
436435
end
437436

0 commit comments

Comments
 (0)
Please sign in to comment.