summaryrefslogtreecommitdiff
path: root/src/game/g_client.c
diff options
context:
space:
mode:
authorMikko Tiusanen <ams@daug.net>2014-09-24 21:40:34 +0300
committerMikko Tiusanen <ams@daug.net>2014-09-24 21:40:34 +0300
commitfab71cd44004636f3298ef9cef363cf82d85c152 (patch)
treeeba517b7e71b724fcfc80652364bf2c78bb46804 /src/game/g_client.c
parenta23e86b0acb4e43d244d6105b59b67be8ab3e1e8 (diff)
Added support for forcing random teams when joining the game.
Diffstat (limited to 'src/game/g_client.c')
-rw-r--r--src/game/g_client.c9
1 files changed, 8 insertions, 1 deletions
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 );
+ }
}
/*