From c2b6ccea5432d961888b4b8b0dc201020f3a5280 Mon Sep 17 00:00:00 2001 From: "M. Kristall" Date: Mon, 4 Jun 2007 19:22:32 +0000 Subject: (bug 2970) fix number of connected player counting and count non-spectators properly (bug 3201) fix a bug where admins following other players can't see team chat --- src/game/g_cmds.c | 7 +++---- src/game/g_main.c | 9 ++++++--- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index dbbfc517..67801999 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -854,8 +854,8 @@ static void G_SayTo( gentity_t *ent, gentity_t *other, int mode, int color, cons if( mode == SAY_TEAM && !OnSameTeam( ent, other ) ) { - if( other->client->ps.stats[ STAT_PTEAM ] != PTE_NONE ) - return; + if( other->client->pers.teamSelection != PTE_NONE ) + return; if( !G_admin_permission( other, ADMF_SPEC_ALLCHAT ) ) return; @@ -927,8 +927,7 @@ void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText ) break; case SAY_TELL: - if( target && - target->client->ps.stats[ STAT_PTEAM ] == ent->client->ps.stats[ STAT_PTEAM ] && + if( target && OnSameTeam( target, ent ) && Team_GetLocationMsg( ent, location, sizeof( location ) ) ) Com_sprintf( name, sizeof( name ), EC"[%s%c%c"EC"] (%s)"EC": ", ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE, location ); diff --git a/src/game/g_main.c b/src/game/g_main.c index 8dd53b29..9f756c61 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1299,15 +1299,19 @@ void CalculateRanks( void ) if ( level.clients[ i ].pers.connected != CON_DISCONNECTED ) { level.sortedClients[ level.numConnectedClients ] = i; + level.numConnectedClients++; P[ i ] = (char)'0' + level.clients[ i ].pers.teamSelection; if( level.clients[ i ].pers.connected != CON_CONNECTED ) continue; - level.numConnectedClients++; + + level.numVotingClients++; if( level.clients[ i ].pers.teamSelection != PTE_NONE ) { level.numPlayingClients++; - level.numNonSpectatorClients++; + if( level.clients[ i ].sess.sessionTeam != TEAM_SPECTATOR ) + level.numNonSpectatorClients++; + if( level.clients[ i ].pers.teamSelection == PTE_ALIENS ) { level.numAlienClients++; @@ -1323,7 +1327,6 @@ void CalculateRanks( void ) } } } - level.numVotingClients = level.numConnectedClients; level.numteamVotingClients[ 0 ] = level.numHumanClients; level.numteamVotingClients[ 1 ] = level.numAlienClients; P[ i + 1 ] = '\0'; -- cgit