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.
This commit is contained in:
Zack Middleton 2019-10-28 21:02:15 -05:00
parent 34c0722b5e
commit dc0c3e7bdf
1 changed files with 6 additions and 4 deletions

View File

@ -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;