]> git.lizzy.rs Git - worldedit.git/commitdiff
Fix /outset and /inset to conform to WE standards
authorDaniel Sosa <sosa.daniel23@gmail.com>
Mon, 16 Feb 2015 02:47:21 +0000 (02:47 +0000)
committerDaniel Sosa <sosa.daniel23@gmail.com>
Mon, 4 Jul 2016 02:44:02 +0000 (21:44 -0500)
worldedit_commands/cuboid.lua

index 47126595adf507c0967eb1f7416fd907d546645b..9efe919069ce32bae4349681fec56444b7e20823 100644 (file)
@@ -2,11 +2,11 @@ dofile(minetest.get_modpath("worldedit_commands") .. "/cuboidapi.lua")
 
 
 minetest.register_chatcommand("/outset", {
-       params = "<amount> [h|v]",
+       params = "[h|v] <amount>",
        description = "outset the selection",
        privs = {worldedit=true},
        func = function(name, param)
-               local find, _, amount, dir = param:find("^(%d+)[%s+]?([hv]?)$")
+               local find, _, dir, amount = param:find("([hv]?)%s*([+-]?%d+)")
                
                if find == nil then
                        return false, "invalid usage: " .. param
@@ -42,11 +42,11 @@ minetest.register_chatcommand("/outset", {
 
 
 minetest.register_chatcommand("/inset", {
-       params = "<amount> [h|v]",
+       params = "[h|v] <amount>",
        description = "inset the selection",
        privs = {worldedit=true},
        func = function(name, param)
-               local find, _, amount, dir = param:find("^(%d+)[%s+]?([hv]?)$")
+               local find, _, dir, amount = param:find("([hv]?)%s*([+-]?%d+)")
                
                if find == nil then
                        return false, "invalid usage: " .. param