diff options
author | Tim Angus <tim@ngus.net> | 2006-04-16 00:17:15 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2006-04-16 00:17:15 +0000 |
commit | 2334d817d142e47ac1965f777e4d7c59aeb97939 (patch) | |
tree | 5d7d82579e24223a0fb5bea562b7af31cfc4cdcc /src | |
parent | 55607e9767280b238fad1e7cdd9b560be9529b6e (diff) |
* Fix to infamous "sarge" bug (R1CH)
* Better balance forcing when swtiching from teams directly (R1CH)
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_client.c | 17 | ||||
-rw-r--r-- | src/game/g_cmds.c | 8 |
2 files changed, 14 insertions, 11 deletions
diff --git a/src/game/g_client.c b/src/game/g_client.c index f0b33e03..f95b23af 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -952,8 +952,6 @@ void ClientUserinfoChanged( int clientNum ) gclient_t *client; char c1[ MAX_INFO_STRING ]; char c2[ MAX_INFO_STRING ]; - char redTeam[ MAX_INFO_STRING ]; - char blueTeam[ MAX_INFO_STRING ]; char userinfo[ MAX_INFO_STRING ]; team_t team; @@ -1078,8 +1076,6 @@ void ClientUserinfoChanged( int clientNum ) // colors strcpy( c1, Info_ValueForKey( userinfo, "color1" ) ); strcpy( c2, Info_ValueForKey( userinfo, "color2" ) ); - strcpy( redTeam, "humans" ); - strcpy( blueTeam, "aliens" ); if( client->ps.pm_flags & PMF_FOLLOW ) team = PTE_NONE; @@ -1088,13 +1084,16 @@ void ClientUserinfoChanged( int clientNum ) // 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, team, model, model, redTeam, blueTeam, c1, c2, - client->pers.maxHealth, client->sess.wins, client->sess.losses, teamTask, teamLeader); - trap_SetConfigstring( CS_PLAYERS + clientNum, s ); + Com_sprintf( userinfo, sizeof( userinfo ), + "n\\%s\\t\\%i\\model\\%s\\hmodel\\%s\\g_redteam\\humans\\g_blueteam\\aliens" + "\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d", + client->pers.netname, team, model, model, c1, c2, + client->pers.maxHealth, client->sess.wins, client->sess.losses, teamTask, teamLeader ); - /*G_LogPrintf( "ClientUserinfoChanged: %i %s\n", clientNum, s );*/ + trap_SetConfigstring( CS_PLAYERS + clientNum, userinfo ); + + /*G_LogPrintf( "ClientUserinfoChanged: %i %s\n", clientNum, userinfo );*/ } diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index ecb6ad39..274f4a4a 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -500,7 +500,9 @@ void Cmd_Team_f( gentity_t *ent ) team = PTE_NONE; else if( !Q_stricmp( s, "aliens" ) ) { - if( g_teamForceBalance.integer && level.numAlienClients > level.numHumanClients ) + if( g_teamForceBalance.integer && ( ( level.numAlienClients > level.numHumanClients ) || + ( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS && + level.numAlienClients >= level.numHumanClients ) ) ) { G_TriggerMenu( ent->client->ps.clientNum, MN_A_TEAMFULL ); return; @@ -510,7 +512,9 @@ void Cmd_Team_f( gentity_t *ent ) } else if( !Q_stricmp( s, "humans" ) ) { - if( g_teamForceBalance.integer && level.numHumanClients > level.numAlienClients ) + if( g_teamForceBalance.integer && ( ( level.numHumanClients > level.numAlienClients ) || + ( ent->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS && + level.numHumanClients >= level.numAlienClients ) ) ) { G_TriggerMenu( ent->client->ps.clientNum, MN_H_TEAMFULL ); return; |