Assign all players to a team (force) in a "pseudo-random" fashion.
This function is called in the scope of
InitGenericPlayerSlotsetc. to set up the map based on chosen default game type.
Players aren't assigned to teams randomly, but in a round-robin way. This means if
teamCount == 2with 4 players:
- player 0 -> team 0
- player 1 -> team 1
- player 2 -> team 0
- player 3 -> team 1
- return type
- Source code
function TeamInitPlayerSlots takes integer teamCount returns nothing local integer index local player indexPlayer local integer team call SetTeams(teamCount) call CheckInitPlayerSlotAvailability() set index = 0 set team = 0 loop if (bj_slotControlUsed[index]) then set indexPlayer = Player(index) call SetPlayerTeam( indexPlayer, team ) set team = team + 1 if (team >= teamCount) then set team = 0 endif endif set index = index + 1 exitwhen index == bj_MAX_PLAYERS endloop endfunction