Function TeamInitPlayerSlots

Line
10052
Location
blizzard.j
Constant?
no
Type
function
Arguments
integer teamCount
Returns
nothing
10052
function TeamInitPlayerSlots takes integer teamCount returns nothing
10053
    local integer index
10054
    local player  indexPlayer
10055
    local integer team
10056
10057
    call SetTeams(teamCount)
10058
10059
    call CheckInitPlayerSlotAvailability()
10060
    set index = 0
10061
    set team = 0
10062
    loop
10063
        if (bj_slotControlUsed[index]) then
10064
            set indexPlayer = Player(index)
10065
            call SetPlayerTeam( indexPlayer, team )
10066
            set team = team + 1
10067
            if (team >= teamCount) then
10068
                set team = 0
10069
            endif
10070
        endif
10071
10072
        set index = index + 1
10073
        exitwhen index == bj_MAX_PLAYERS
10074
    endloop
10075
endfunction