summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/g_client.c17
-rw-r--r--src/game/g_cmds.c8
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;