Skip to content
Permalink
Browse files

Implement some safety mechanisms

  • Loading branch information
danierukun committed Jul 4, 2016
1 parent f8f1f3b commit 48f3f59fc3b03e0114ef8070f59fd58b918cc253
Showing with 15 additions and 5 deletions.
  1. +1 −1 worldedit_commands/cuboid.lua
  2. +14 −4 worldedit_commands/cuboidapi.lua
@@ -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

0 comments on commit 48f3f59

Please sign in to comment.