Skip to content

Commit 9fec002

Browse files
committed
Log error for invalid facedir param2s
1 parent 133988d commit 9fec002

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

worldedit/manipulations.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,15 @@ function worldedit.orient(pos1, pos2, angle)
601601
elseif paramtype2 == "facedir" or
602602
paramtype2 == "colorfacedir" then
603603
local orient = node.param2 % 32
604-
node.param2 = node.param2 - orient +
605-
facedir_substitution[orient + 1]
606-
swap_node(pos, node)
607-
count = count + 1
604+
if facedir_substitution[orient + 1] then
605+
node.param2 = node.param2 - orient +
606+
facedir_substitution[orient + 1]
607+
swap_node(pos, node)
608+
count = count + 1
609+
else
610+
core.log("error", "[worldedit] Bad " .. paramtype2 ..
611+
" value in node " .. dump(node))
612+
end
608613
end
609614
end
610615
pos.z = pos.z + 1

0 commit comments

Comments
 (0)