Skip to content

Commit

Permalink
Implement some safety mechanisms
Browse files Browse the repository at this point in the history
  • Loading branch information
danierukun committed Jul 4, 2016
1 parent f8f1f3b commit 48f3f59
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion worldedit_commands/cuboid.lua
Expand Up @@ -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))
Expand Down
18 changes: 14 additions & 4 deletions worldedit_commands/cuboidapi.lua
Expand Up @@ -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
Expand Down

0 comments on commit 48f3f59

Please sign in to comment.