forked from mtcontrib/Minetest-WorldEdit
Implement some safety mechanisms
This commit is contained in:
parent
f8f1f3b9cc
commit
48f3f59fc3
@ -109,7 +109,7 @@ minetest.register_chatcommand("/shift", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
if axis == nil or dir == nil then
|
if axis == nil or dir == nil then
|
||||||
return false, "Invalid"
|
return false, "Invalid if looking straight up or down"
|
||||||
end
|
end
|
||||||
|
|
||||||
assert(worldedit.cuboid_shift(name, axis, amount * dir))
|
assert(worldedit.cuboid_shift(name, axis, amount * dir))
|
||||||
|
@ -215,14 +215,24 @@ worldedit.translate_direction = function(name, direction)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if direction == "front" then
|
if direction == "front" then
|
||||||
|
if axis == "y" then
|
||||||
|
resaxis = nil
|
||||||
|
resdir = nil
|
||||||
|
else
|
||||||
resaxis = axis
|
resaxis = axis
|
||||||
resdir = dir
|
resdir = dir
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if direction == "back" then
|
if direction == "back" then
|
||||||
|
if axis == "y" then
|
||||||
|
resaxis = nil
|
||||||
|
resdir = nil
|
||||||
|
else
|
||||||
resaxis = axis
|
resaxis = axis
|
||||||
resdir = -dir
|
resdir = -dir
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if direction == "left" then
|
if direction == "left" then
|
||||||
if axis == 'x' then
|
if axis == 'x' then
|
||||||
|
Loading…
Reference in New Issue
Block a user