mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2025-01-12 11:00:28 +01:00
Warn about invalid //stretch usage
This commit is contained in:
parent
b37605943b
commit
b2b2b9364d
@ -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/?`
|
||||
|
||||
|
@ -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 stretchx * stretchy * stretchz * count
|
||||
end
|
||||
return nil
|
||||
end),
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user