summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2005-07-17 01:59:35 +0000
committerTim Angus <tim@ngus.net>2005-07-17 01:59:35 +0000
commitb5ac53b13319050369c3baba84554b0561db6c96 (patch)
tree7c0ab2475e3f7a303f8a266d779187e100a8481b /src/game
parent4b5b1529bd5a4abe937fe66f41bc1debfbca4e37 (diff)
* Hopefully fixed scoreboard issues
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_client.c10
-rw-r--r--src/game/g_main.c40
2 files changed, 11 insertions, 39 deletions
diff --git a/src/game/g_client.c b/src/game/g_client.c
index e5c90d70..0b4a1222 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -957,6 +957,7 @@ void ClientUserinfoChanged( int clientNum )
char redTeam[ MAX_INFO_STRING ];
char blueTeam[ MAX_INFO_STRING ];
char userinfo[ MAX_INFO_STRING ];
+ team_t team;
ent = g_entities + clientNum;
client = ent->client;
@@ -1073,11 +1074,16 @@ void ClientUserinfoChanged( int clientNum )
strcpy( c2, Info_ValueForKey( userinfo, "color2" ) );
strcpy( redTeam, "humans" );
strcpy( blueTeam, "aliens" );
-
+
+ if( client->ps.pm_flags & PMF_FOLLOW )
+ team = PTE_NONE;
+ else
+ team = client->ps.stats[ STAT_PTEAM ];
+
// send over a subset of the userinfo keys so other clients can
// print scoreboards, display models, and play custom sounds
s = va( "n\\%s\\t\\%i\\model\\%s\\hmodel\\%s\\g_redteam\\%s\\g_blueteam\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d",
- client->pers.netname, client->ps.stats[ STAT_PTEAM ], model, model, redTeam, blueTeam, c1, c2,
+ client->pers.netname, team, model, model, redTeam, blueTeam, c1, c2,
client->pers.maxHealth, client->sess.wins, client->sess.losses, teamTask, teamLeader);
trap_SetConfigstring( CS_PLAYERS + clientNum, s );
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 5d10285f..15b19df9 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -628,47 +628,13 @@ int QDECL SortRanks( const void *a, const void *b )
ca = &level.clients[ *(int *)a ];
cb = &level.clients[ *(int *)b ];
- // sort special clients last
- if( ca->sess.spectatorState == SPECTATOR_SCOREBOARD || ca->sess.spectatorClient < 0 )
- return 1;
-
- if( cb->sess.spectatorState == SPECTATOR_SCOREBOARD || cb->sess.spectatorClient < 0 )
- return -1;
-
- // then connecting clients
- if( ca->pers.connected == CON_CONNECTING )
- return 1;
-
- if( cb->pers.connected == CON_CONNECTING )
- return -1;
-
-
- // then spectators
- if( ca->sess.sessionTeam == TEAM_SPECTATOR && cb->sess.sessionTeam == TEAM_SPECTATOR )
- {
- if( ca->sess.spectatorTime < cb->sess.spectatorTime )
- return -1;
-
- if( ca->sess.spectatorTime > cb->sess.spectatorTime )
- return 1;
-
- return 0;
- }
-
- if( ca->sess.sessionTeam == TEAM_SPECTATOR )
- return 1;
-
- if( cb->sess.sessionTeam == TEAM_SPECTATOR )
- return -1;
-
// then sort by score
if( ca->ps.persistant[ PERS_SCORE ] > cb->ps.persistant[ PERS_SCORE ] )
return -1;
-
- if( ca->ps.persistant[ PERS_SCORE ] < cb->ps.persistant[ PERS_SCORE ] )
+ else if( ca->ps.persistant[ PERS_SCORE ] < cb->ps.persistant[ PERS_SCORE ] )
return 1;
-
- return 0;
+ else
+ return 0;
}
/*