It seems there are some problems related to spectators and the priority of team-selection if a player is defined in multiple places in a match configuration.
This change ensures that team assignment is always in this priority:
Spectator
Coach for team1
Coach for team2
Player on team1
Player on team2
Spectators cannot ".coach" and they will be removed if they exceed the mp_spectators_max cvar.
Renamed GetTeamAuths to GetTeamPlayers, so it has more consistent naming, as the one for coaches simply is GetTeamCoaches. Renamed g_TeamAuths to g_TeamPlayers as well.
GetAuthMatchCoachTeam has been merged into GetMatchTeamFromAuth and renamed for a single-point-of-entry that handles the logical flow for which team you belong to.
Consistently reset the player auth arrays when loading teams or spectator dictionaries. This was a bit hit-and-miss before.
Allow spectators in scrim templates, which this new logic allows.
Avoid duplicate calls to GetClientMatchTeam in GetPlayerStat + GetPlayerStat when incrementing stats. Tested and works.
It seems there are some problems related to spectators and the priority of team-selection if a player is defined in multiple places in a match configuration.
This change ensures that team assignment is always in this priority:
Spectators cannot ".coach" and they will be removed if they exceed the
mp_spectators_max
cvar.Renamed
GetTeamAuths
toGetTeamPlayers
, so it has more consistent naming, as the one for coaches simply isGetTeamCoaches
. Renamedg_TeamAuths
tog_TeamPlayers
as well.GetAuthMatchCoachTeam
has been merged intoGetMatchTeamFromAuth
and renamed for a single-point-of-entry that handles the logical flow for which team you belong to.Consistently reset the player auth arrays when loading teams or spectator dictionaries. This was a bit hit-and-miss before.
Allow spectators in scrim templates, which this new logic allows.
Avoid duplicate calls to
GetClientMatchTeam
inGetPlayerStat
+GetPlayerStat
when incrementing stats. Tested and works.I would like to release this as 0.10.2.