EnumUnitsSelected

Parameters
whichPlayer player
enumFilter boolexpr
enumAction code
comment

For the target player choose all currently selected units that match the filter and run enumAction on them.

bug

Leaks handle g: In Jass you must set local variables that hold agents (or any child type) to null at the end of functions to avoid reference counter leaks.

note

Destroys the enumFilter boolexpr received as argument.

patch

1.00

Source
Blizzard.j
return type
nothing
Source code
function EnumUnitsSelected takes player whichPlayer, boolexpr enumFilter, code enumAction returns nothing
    local group g = CreateGroup()
    call SyncSelections()
    call GroupEnumUnitsSelected(g, whichPlayer, enumFilter)
    call DestroyBoolExpr(enumFilter)
    call ForGroup(g, enumAction)
    call DestroyGroup(g)
endfunction