I'm having an issue with my JASS Slide script, because I want it to select a certain type of unit and slide all of them. When I use this one, it slides but then I guess of memory leaks or something it makes the map unplayable and soon locks up without a crash message and I have to kill the process.
Any ideas?
JASS:
function slide takes nothing returns nothing
local group g = GetUnitsOfTypeIdAll('h001')
local unit u = FirstOfGroup(g)
local location l
call BJDebugMsg(GetUnitName(u))
loop
exitwhen g == null
set l = PolarProjectionBJ(GetUnitLoc(u), 20.00, 270.00)
call SetUnitPositionLoc( u, l )
call GroupRemoveUnit(g, u)
set u = FirstOfGroup(g)
endloop
call DestroyGroup(g)
set u = null
endfunction
Any ideas?