]> git.lizzy.rs Git - worldedit.git/commitdiff
Implement some safety mechanisms
authorDaniel Sosa <sosa.daniel23@gmail.com>
Mon, 16 Feb 2015 04:15:52 +0000 (04:15 +0000)
committerDaniel Sosa <sosa.daniel23@gmail.com>
Mon, 4 Jul 2016 02:44:02 +0000 (21:44 -0500)
worldedit_commands/cuboid.lua
worldedit_commands/cuboidapi.lua

index 2a5a9fbd4b62f23446016d080e8483d57a853233..003b358224820de9498b840b578b51987a27abfc 100644 (file)
@@ -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))
index d91b0714a3a281f1d6faf8596f415e3f38462bcb..ce207615c768a3abb8c082dcbdad3ef8d18d2777 100644 (file)
@@ -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