summaryrefslogtreecommitdiff
path: root/src/game/g_main.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-04-15 23:53:51 +0000
committerTim Angus <tim@ngus.net>2006-04-15 23:53:51 +0000
commit55607e9767280b238fad1e7cdd9b560be9529b6e (patch)
tree8ffb40b91377c040cc1358223447870280fdefc7 /src/game/g_main.c
parent25fcd1f90c39ce5c7eb4dfab0fedb4388ad4289c (diff)
* Lucifer cannon exploit fix (R1CH)
* Sudden death/time limit warnings (R1CH)
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r--src/game/g_main.c41
1 files changed, 37 insertions, 4 deletions
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 ||