Fix duplicate team join center print for bots and g_teamAutoJoin

My 2017 commit f7c3276 ("Fix g_teamAutoJoin and g_teamForceBalance")
caused BroadcastTeamChange() to be run an extra time when bots connect.
This caused a duplicate center print message to be sent to all clients.

g_teamAutoJoin 1 sent an extra center print when any player or bot
connects. Though that is the original behavior from Team Arena.

Team set during connection no longer sends broadcast as it will be
sent later in ClientConnect().

Reported by Pascal Brochart (pbrochart) as causing clients to be
kicked due to server command overflow if many bots join at the
same time.
This commit is contained in:
Zack Middleton 2019-11-16 00:57:17 -06:00
parent dc0c3e7bdf
commit a6e66700e1

View file

@ -637,8 +637,6 @@ void SetTeam( gentity_t *ent, const char *s ) {
CheckTeamLeader( oldTeam );
}
BroadcastTeamChange( client, oldTeam );
// get and distribute relevant parameters
ClientUserinfoChanged( clientNum );
@ -647,6 +645,8 @@ void SetTeam( gentity_t *ent, const char *s ) {
return;
}
BroadcastTeamChange( client, oldTeam );
ClientBegin( clientNum );
}