From 55607e9767280b238fad1e7cdd9b560be9529b6e Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sat, 15 Apr 2006 23:53:51 +0000 Subject: * Lucifer cannon exploit fix (R1CH) * Sudden death/time limit warnings (R1CH) --- src/game/g_main.c | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) (limited to 'src/game/g_main.c') diff --git a/src/game/g_main.c b/src/game/g_main.c index b07afc75..a5a06728 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -910,11 +910,32 @@ 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 ) ) + if( g_suddenDeathTime.integer ) { - localHTP = 0; - localATP = 0; + if( !level.warmupTime && + ( level.time - level.startTime >= g_suddenDeathTime.integer * 60000 ) ) + { + localHTP = 0; + localATP = 0; + + //warn about sudden death + if( level.time - level.startTime >= g_suddenDeathTime.integer * 60000 && + level.suddenDeathWarning < TW_PASSED ) + { + trap_SendServerCommand( -1, "cp \"Sudden Death!\"" ); + level.suddenDeathWarning = TW_PASSED; + } + } + else + { + //warn about sudden death + if( level.time - level.startTime >= ( g_suddenDeathTime.integer - 1 ) * 60000 && + level.suddenDeathWarning < TW_IMMINENT ) + { + trap_SendServerCommand( -1, "cp \"Sudden Death in 1 minute!\"" ); + level.suddenDeathWarning = TW_IMMINENT; + } + } } else { @@ -1721,6 +1742,18 @@ void CheckExitRules( void ) LogExit( "Timelimit hit." ); return; } + else if( level.time - level.startTime >= ( g_timelimit.integer - 5 ) * 60000 && + level.timelimitWarning < TW_IMMINENT ) + { + trap_SendServerCommand( -1, "cp \"5 minutes remaining!\"" ); + level.timelimitWarning = TW_IMMINENT; + } + else if( level.time - level.startTime >= ( g_timelimit.integer - 1 ) * 60000 && + level.timelimitWarning < TW_PASSED ) + { + trap_SendServerCommand( -1, "cp \"1 minute remaining!\"" ); + level.timelimitWarning = TW_PASSED; + } } if( level.uncondHumanWin || -- cgit