summaryrefslogtreecommitdiff
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
parent25fcd1f90c39ce5c7eb4dfab0fedb4388ad4289c (diff)
* Lucifer cannon exploit fix (R1CH)
* Sudden death/time limit warnings (R1CH)
-rw-r--r--src/game/bg_pmove.c2
-rw-r--r--src/game/g_local.h11
-rw-r--r--src/game/g_main.c41
3 files changed, 49 insertions, 5 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index a2a9f543..c1c97142 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -3021,7 +3021,7 @@ static void PM_Weapon( void )
if( !BG_FindInfinteAmmoForWeapon( pm->ps->weapon ) )
{
//special case for lCanon
- if( pm->ps->weapon == WP_LUCIFER_CANNON && attack1 )
+ if( pm->ps->weapon == WP_LUCIFER_CANNON && attack1 && !attack2 )
{
ammo -= (int)( ceil( ( (float)pm->ps->stats[ STAT_MISC ] / (float)LCANNON_TOTAL_CHARGE ) * 10.0f ) );
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 874afeee..1d6bc99e 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -478,6 +478,14 @@ typedef struct armourRegion_s
qboolean crouch;
} armourRegion_t;
+//status of the warning of certain events
+typedef enum
+{
+ TW_NOT = 0,
+ TW_IMMINENT,
+ TW_PASSED
+} timeWarning_t;
+
//
// this structure is cleared as each map is entered
//
@@ -593,6 +601,9 @@ typedef struct
pTeam_t lastWin;
+ timeWarning_t suddenDeathWarning;
+ timeWarning_t timelimitWarning;
+
spawnQueue_t alienSpawnQueue;
spawnQueue_t humanSpawnQueue;
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 ||