- Joined
- Aug 3, 2008
- Messages
- 2,345
This isn't much, but I felt wc3 was lacking this function. It basically changes the terrain inside a rect to whatever you want. Here's the code:
I don't know why, but this function doesn't work after TriggerSleepAction is called, but I'm sure there are ways round that, such as using a timer, though I haven't tested any.
JASS:
function SetRectTerrainType takes rect r, integer terrainType, integer variation returns nothing
local real minx = GetRectMinX(r)
local real miny = GetRectMinY(r)
local real maxx = GetRectMaxX(r)
local real maxy = GetRectMaxY(r)
local real x = minx
local real y = miny
loop
exitwhen y >= maxy
loop
exitwhen x >= maxx
call SetTerrainType(x, y, terrainType, variation, 1, 1)
set x = x + 128.0
endloop
set y = y + 128.0
set x = minx
endloop
endfunction
Last edited: