]> git.lizzy.rs Git - worldedit.git/commitdiff
Warn about invalid //stretch usage
authorsfan5 <sfan5@live.de>
Thu, 15 Nov 2018 19:48:20 +0000 (20:48 +0100)
committersfan5 <sfan5@live.de>
Thu, 15 Nov 2018 19:49:19 +0000 (20:49 +0100)
ChatCommands.md
worldedit_commands/init.lua

index ea1f9557309564d05ece86b4472846fff8d6691a..528f2dfc02280c0974ea1a3b3b819e74202252fb 100644 (file)
@@ -289,9 +289,9 @@ Stack the current WorldEdit region `<count>` times by offset `<x>`, `<y>`, `<z>`
 \r
 Scale the current WorldEdit positions and region by a factor of `<stretchx>`, `<stretchy>`, `<stretchz>` along the X, Y, and Z axes, repectively, with position 1 as the origin.\r
 \r
-    //scale 2 2 2\r
-    //scale 1 2 1\r
-    //scale 10 20 1\r
+    //stretch 2 2 2\r
+    //stretch 1 2 1\r
+    //stretch 10 20 1\r
 \r
 ### `//transpose x/y/z/? x/y/z/?`\r
 \r
index 131c49b8509b646934eeb3490eae6fec1fb6395e..763e89597c8683eb1baa41ae89a3feb61044f29f 100644 (file)
@@ -905,9 +905,12 @@ minetest.register_chatcommand("/stretch", {
                stretchx, stretchy, stretchz = tonumber(stretchx), tonumber(stretchy), tonumber(stretchz)\r
                if stretchx == 0 or stretchy == 0 or stretchz == 0 then\r
                        worldedit.player_notify(name, "invalid scaling factors: " .. param)\r
+                       return nil\r
                end\r
                local count = check_region(name, param)\r
-               if count then return tonumber(stretchx) * tonumber(stretchy) * tonumber(stretchz) * count end\r
+               if count then\r
+                       return stretchx * stretchy * stretchz * count\r
+               end\r
                return nil\r
        end),\r
 })\r