diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_client.c | 10 | ||||
-rw-r--r-- | src/game/g_main.c | 40 |
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; } /* |