- Joined
- Feb 11, 2011
- Messages
- 1,860
Hi guys,
I have a question: when you set group A = group B and you use a FirstOfGroup loop to count the units in group B, does it also remove the units from group A? For example:
The first time I run this, it is fine. The second time it returns 0. I have a feeling that units are removed from the creeps group when they are removed from the enumG group. Is this true?
Thanks,
Mr_Bean
I have a question: when you set group A = group B and you use a FirstOfGroup loop to count the units in group B, does it also remove the units from group A? For example:
JASS:
function GetAliveCreeps takes nothing returns integer
local unit temp
local integer count = 0
call GroupClear(enumG)
set enumG = creeps
loop
set temp = FirstOfGroup(enumG)
exitwhen temp == null
set count = count + 1
call GroupRemoveUnit(enumG, temp)
endloop
return count
endfunction
The first time I run this, it is fine. The second time it returns 0. I have a feeling that units are removed from the creeps group when they are removed from the enumG group. Is this true?
Thanks,
Mr_Bean