From dc0c3e7bdf8341d080289111a1a389621121ab0d Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Mon, 28 Oct 2019 21:02:15 -0500 Subject: [PATCH] Fix team orders menu not listing clients with lower clientnums If bots join before the local client (dedicated server) the bots would not be listed in the Q3A team orders menu and so they could not be given orders using the menu. The Q3A team orders menu got local client's team while looping through all clients. Ignoring any bots with clientnum lower than the local client. Get local client's team before the loop so all bots are listed. --- code/q3_ui/ui_teamorders.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/q3_ui/ui_teamorders.c b/code/q3_ui/ui_teamorders.c index d116e016..fdcb902a 100644 --- a/code/q3_ui/ui_teamorders.c +++ b/code/q3_ui/ui_teamorders.c @@ -295,7 +295,7 @@ static void UI_TeamOrdersMenu_BuildBotList( void ) { int numPlayers; int isBot; int n; - char playerTeam = '3'; + char playerTeam; char botTeam; char info[MAX_INFO_STRING]; @@ -312,14 +312,16 @@ static void UI_TeamOrdersMenu_BuildBotList( void ) { numPlayers = atoi( Info_ValueForKey( info, "sv_maxclients" ) ); teamOrdersMenuInfo.gametype = atoi( Info_ValueForKey( info, "g_gametype" ) ); - for( n = 0; n < numPlayers && teamOrdersMenuInfo.numBots < 9; n++ ) { - trap_GetConfigString( CS_PLAYERS + n, info, MAX_INFO_STRING ); + trap_GetConfigString( CS_PLAYERS + cs.clientNum, info, MAX_INFO_STRING ); + playerTeam = *Info_ValueForKey( info, "t" ); + for( n = 0; n < numPlayers && teamOrdersMenuInfo.numBots < 9; n++ ) { if( n == cs.clientNum ) { - playerTeam = *Info_ValueForKey( info, "t" ); continue; } + trap_GetConfigString( CS_PLAYERS + n, info, MAX_INFO_STRING ); + isBot = atoi( Info_ValueForKey( info, "skill" ) ); if( !isBot ) { continue;