mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-11-13 06:00:19 +01:00
Implement some safety mechanisms
This commit is contained in:
parent
f8f1f3b9cc
commit
48f3f59fc3
|
@ -109,7 +109,7 @@ minetest.register_chatcommand("/shift", {
|
|||
end
|
||||
|
||||
if axis == nil or dir == nil then
|
||||
return false, "Invalid"
|
||||
return false, "Invalid if looking straight up or down"
|
||||
end
|
||||
|
||||
assert(worldedit.cuboid_shift(name, axis, amount * dir))
|
||||
|
|
|
@ -215,13 +215,23 @@ worldedit.translate_direction = function(name, direction)
|
|||
end
|
||||
|
||||
if direction == "front" then
|
||||
resaxis = axis
|
||||
resdir = dir
|
||||
if axis == "y" then
|
||||
resaxis = nil
|
||||
resdir = nil
|
||||
else
|
||||
resaxis = axis
|
||||
resdir = dir
|
||||
end
|
||||
end
|
||||
|
||||
if direction == "back" then
|
||||
resaxis = axis
|
||||
resdir = -dir
|
||||
if axis == "y" then
|
||||
resaxis = nil
|
||||
resdir = nil
|
||||
else
|
||||
resaxis = axis
|
||||
resdir = -dir
|
||||
end
|
||||
end
|
||||
|
||||
if direction == "left" then
|
||||
|
|
Loading…
Reference in New Issue
Block a user