SelectByIllusion
not ratedFilters g for units that are / are not illusions. Mainly for usage in AI as it destroys g.
Usually used like this:
set g = SelectByIllusion(g, false)
Usually used like this:
set g = SelectByIllusion(g, false)
function SelectByIllusion takes group g, boolean is_illusion returns group
local unit u = null
local group rg = CreateGroup()
loop
set u = FirstOfGroup(g)
exitwhen u == null
if IsUnitIllusion(u) == is_illusion then
call GroupAddUnit(rg, u )
endif
call GroupRemoveUnit(g, u )
endloop
call DestroyGroup(g)
return rg
endfunctionNo comments.