From a6e66700e144e86e0b63aff8b7b67bbec3990860 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sat, 16 Nov 2019 00:57:17 -0600 Subject: [PATCH] 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. --- code/game/g_cmds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index b96b567d..f349a1bc 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -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 ); }