CheckInitPlayerSlotAvailability

comment

This function will pre-initialize bj_slotControlUsed and bj_slotControl arrays, representing player slots, with default values of false and MAP_CONTROL_USER.

note

It is safe to call this function repeatedly, it will only ever run the initialization once.

patch

1.00

Source
Blizzard.j (raise an issue to discuss on Github or submit a PR)
return type
nothing
Source code
function CheckInitPlayerSlotAvailability takes nothing returns nothing
    local integer index

    if (not bj_slotControlReady) then
        set index = 0
        loop
            set bj_slotControlUsed[index] = false
            set bj_slotControl[index] = MAP_CONTROL_USER
            set index = index + 1
            exitwhen index == bj_MAX_PLAYERS
        endloop
        set bj_slotControlReady = true
    endif
endfunction