Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Warn about invalid //stretch usage
  • Loading branch information
sfan5 committed Nov 15, 2018
1 parent b376059 commit 48e638a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ChatCommands.md
Expand Up @@ -289,9 +289,9 @@ Stack the current WorldEdit region `<count>` times by offset `<x>`, `<y>`, `<z>`

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.

//scale 2 2 2
//scale 1 2 1
//scale 10 20 1
//stretch 2 2 2
//stretch 1 2 1
//stretch 10 20 1

### `//transpose x/y/z/? x/y/z/?`

Expand Down
5 changes: 4 additions & 1 deletion worldedit_commands/init.lua
Expand Up @@ -905,9 +905,12 @@ minetest.register_chatcommand("/stretch", {
stretchx, stretchy, stretchz = tonumber(stretchx), tonumber(stretchy), tonumber(stretchz)
if stretchx == 0 or stretchy == 0 or stretchz == 0 then
worldedit.player_notify(name, "invalid scaling factors: " .. param)
return nil
end
local count = check_region(name, param)
if count then return tonumber(stretchx) * tonumber(stretchy) * tonumber(stretchz) * count end
if count then
return tonumber(stretchx) * tonumber(stretchy) * tonumber(stretchz) * count
end
return nil
end),
})
Expand Down

0 comments on commit 48e638a

Please sign in to comment.