Skip to content

Commit 5b6d448

Browse files
tenplus1SmallJoker
authored andcommittedSep 16, 2017
Fix Rotate Node Placement (#6424)
This properly checks for creative mode or privilege when using fixed rotate_node() function.
1 parent 45e9f80 commit 5b6d448

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

Diff for: ‎builtin/common/misc_helpers.lua

+6-2
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,15 @@ if INIT == "game" then
425425
--Wrapper for rotate_and_place() to check for sneak and assume Creative mode
426426
--implies infinite stacks when performing a 6d rotation.
427427
--------------------------------------------------------------------------------
428-
428+
local creative_mode_cache = core.settings:get_bool("creative_mode")
429+
local function is_creative(name)
430+
return creative_mode_cache or
431+
core.check_player_privs(name, {creative = true})
432+
end
429433

430434
core.rotate_node = function(itemstack, placer, pointed_thing)
431435
core.rotate_and_place(itemstack, placer, pointed_thing,
432-
core.settings:get_bool("creative_mode"),
436+
is_creative(placer:get_player_name()),
433437
{invert_wall = placer:get_player_control().sneak})
434438
return itemstack
435439
end

0 commit comments

Comments
 (0)
Please sign in to comment.