]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Fix rotate_node to return the correct itemstack.
authorAaron Suen <warr1024@gmail.com>
Sun, 13 Oct 2019 13:32:39 +0000 (09:32 -0400)
committersfan5 <sfan5@live.de>
Sun, 13 Oct 2019 15:11:00 +0000 (17:11 +0200)
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.

builtin/common/misc_helpers.lua

index d6673a691c58495777963486819e87742dcc89e3..88a498927a335e4eb1a7311e85575de75da3d8e3 100644 (file)
@@ -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