From fab71cd44004636f3298ef9cef363cf82d85c152 Mon Sep 17 00:00:00 2001 From: Mikko Tiusanen Date: Wed, 24 Sep 2014 21:40:34 +0300 Subject: Added support for forcing random teams when joining the game. --- src/game/g_client.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/game/g_client.c') diff --git a/src/game/g_client.c b/src/game/g_client.c index fc797e5..1d50a97 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1229,7 +1229,6 @@ char *ClientConnect( int clientNum, qboolean firstTime ) G_ChangeTeam( ent, client->sess.restartTeam ); client->sess.restartTeam = TEAM_NONE; } - return NULL; } @@ -1299,6 +1298,14 @@ void ClientBegin( int clientNum ) client->sess.seenWelcome = 1; G_TriggerMenu( client->ps.clientNum, MN_WELCOME ); } + + if ( g_ForceRandomTeams.integer ) { + if( level.numAlienClients > level.numHumanClients ) { + G_ChangeTeam( ent, TEAM_HUMANS ); + } else if( level.numHumanClients > level.numAlienClients ) { + G_ChangeTeam( ent, TEAM_ALIENS ); + } else G_ChangeTeam( ent, random() >= 0.5f ? TEAM_ALIENS : TEAM_HUMANS ); + } } /* -- cgit