summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2007-06-04 19:22:32 +0000
committerM. Kristall <mkpdev@gmail.com>2007-06-04 19:22:32 +0000
commitc2b6ccea5432d961888b4b8b0dc201020f3a5280 (patch)
tree050436ff5e069b392e705514e83c63cccd74ce6a /src
parentaf9c625a3342888a412ddc0aa81f703666d8264f (diff)
(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
Diffstat (limited to 'src')
-rw-r--r--src/game/g_cmds.c7
-rw-r--r--src/game/g_main.c9
2 files changed, 9 insertions, 7 deletions
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';