- Joined
- Nov 24, 2007
- Messages
- 55
So I have the following code:
and it is called by the following line of code
My question is...at the end of my iteration through the group, do I need to destroy it and set the variable (g, as was handed by the other call) to null? I know i could to be safe (and I don't use the group after this point...but what if I did? Is this pass by value or pass by reference, i assume the latter...)
Thanks
JASS:
function Trig_Boss_FindLowestHP takes group g returns unit
local unit u
local unit lowest
loop
set u = FirstOfGroup(g)
exitwhen ( u == null )
// we know U is not null...
if( lowest == null ) then
set lowest = u
else
if( GetUnitLifePercent(u) < GetUnitLifePercent(lowest)) then
set lowest = u
endif
endif
call GroupRemoveUnit(g, u)
endloop
set u = null
return lowest
endfunction
and it is called by the following line of code
JASS:
local unit target = Trig_Boss_FindLowestHP(g)
My question is...at the end of my iteration through the group, do I need to destroy it and set the variable (g, as was handed by the other call) to null? I know i could to be safe (and I don't use the group after this point...but what if I did? Is this pass by value or pass by reference, i assume the latter...)
Thanks