saw792
Is known to say things. That is all.
- Reaction score
- 280
It also leaks two groups. But if I must fix my freehanded code...
JASS:
function GroupRunFilter takes group g, boolexpr filter returns group
local group g1 = CreateGroup()
local group g2 = CreateGroup()
local integer i = 0
local unit u = null
call GroupEnumUnitsInRect(g1, bj_mapInitialPlayableArea, filter)
call GroupAddGroup(g, g2)
loop
set u = FirstOfGroup(g2)
exitwhen u == null
if IsUnitInGroup(u, g1) == false then
call GroupRemoveUnit(g)
endif
call GroupRemoveUnit(u, g2)
endloop
call DestroyGroup(g1)
call DestroyGroup(g2)
set g1 = null
set g2 = null
return g
endfunction