BlzAllUnitsEnableAurasBJ

Parameters
enableboolean
affectsUIboolean
comment
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.

patch

3.0.0.24268

Source
Blizzard.j (raise an issue to discuss on Github or submit a PR)
return type
nothing
Source code
function BlzAllUnitsEnableAurasBJ takes boolean enable, boolean affectsUI returns nothing
    local integer index
    local player  indexPlayer
    local group   g

    set bj_enableAurasAllUnits = enable
    set bj_affectsUIAurasAllUnits = affectsUI
    set g = CreateGroup()
    set index = 0
    loop
        set indexPlayer = Player( index )

        // Enumerate and enable/disable auras on every unit owned by the player.
        call GroupEnumUnitsOfPlayer( g, indexPlayer, null )
        call ForGroup( g, function BlzAllUnitsEnableAurasBJEnum )
        call GroupClear( g )

        set index = index + 1
        exitwhen index == bj_MAX_PLAYER_SLOTS
    endloop
    call DestroyGroup(g)
endfunction