The search keyword must be a single word (no spaces).

Function GroupPickRandomUnit

Line
4706
Location
blizzard.j
Constant?
no
Type
function
Arguments
group whichGroup
Returns
unit
4706
function GroupPickRandomUnit takes group whichGroup returns unit
4707
    // If the user wants the group destroyed, remember that fact and clear
4708
    // the flag, in case it is used again in the callback.
4709
    local boolean wantDestroy = bj_wantDestroyGroup
4710
    set bj_wantDestroyGroup = false
4711
4712
    set bj_groupRandomConsidered = 0
4713
    set bj_groupRandomCurrentPick = null
4714
    call ForGroup(whichGroup, function GroupPickRandomUnitEnum)
4715
4716
    // If the user wants the group destroyed, do so now.
4717
    if (wantDestroy) then
4718
        call DestroyGroup(whichGroup)
4719
    endif
4720
    return bj_groupRandomCurrentPick
4721
endfunction