From 2fda7c89948df9abe53fd273b62e29f7e36a59e8 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Fri, 5 Aug 2005 23:02:22 +0000 Subject: * Added g_suddenDeathTime - when this time is passed all build points are taken away * Server should no longer need a client connected to change map when the timelimit hits --- src/game/g_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/game/g_main.c b/src/game/g_main.c index c0c37589..98566cb4 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -34,6 +34,7 @@ gclient_t g_clients[ MAX_CLIENTS ]; vmCvar_t g_fraglimit; vmCvar_t g_timelimit; +vmCvar_t g_suddenDeathTime; vmCvar_t g_capturelimit; vmCvar_t g_friendlyFire; vmCvar_t g_password; @@ -111,6 +112,7 @@ static cvarTable_t gameCvarTable[ ] = // change anytime vars { &g_timelimit, "timelimit", "0", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, + { &g_suddenDeathTime, "g_suddenDeathTime", "0", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, { &g_synchronousClients, "g_synchronousClients", "0", CVAR_SYSTEMINFO, 0, qfalse }, @@ -908,6 +910,18 @@ void G_CalculateBuildPoints( void ) int localHTP = g_humanBuildPoints.integer, localATP = g_alienBuildPoints.integer; + if( g_suddenDeathTime.integer && !level.warmupTime && + ( level.time - level.startTime >= g_suddenDeathTime.integer * 60000 ) ) + { + localHTP = 0; + localATP = 0; + } + else + { + localHTP = g_humanBuildPoints.integer; + localATP = g_alienBuildPoints.integer; + } + level.humanBuildPoints = level.humanBuildPointsPowered = localHTP; level.alienBuildPoints = localATP; @@ -1514,6 +1528,13 @@ void CheckIntermissionExit( void ) gclient_t *cl; int readyMask; + //if no clients are connected, just exit + if( !level.numConnectedClients ) + { + ExitLevel( ); + return; + } + // see which players are ready ready = 0; notReady = 0; -- cgit