- Joined
- Jun 1, 2007
- Messages
- 98
JASS:
function KillAll takes nothing returns nothing
local group KG = GetUnitsSelectedAll(GetTriggerPlayer())
local unit u
local location Pos
local effect x
loop
exitwhen CountUnitsInGroup(KG) <= 0
set u = GroupPickRandomUnit( KG )
set Pos = GetUnitLoc( u )
call AddSpecialEffectLocBJ( Pos, "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
set x = GetLastCreatedEffectBJ()
call KillUnit( u )
call PolledWait(1.00)
call RemoveUnit( u )
call PolledWait(0.50)
call DestroyEffect( x )
call RemoveLocation( Pos )
endloop
call DestroyGroup( KG )
endfunction
Does the above leak? I think i've removed everything that could leak, but i'm not sure...
I only started learning Jass about 20 minutes ago... It's my first code which actually works.