forked from mtcontrib/Minetest-WorldEdit
		
	Warn about invalid //stretch usage
This commit is contained in:
		@@ -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),
 | 
			
		||||
})
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user