diff options
author | Tim Angus <tim@ngus.net> | 2009-10-03 11:40:33 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:15:13 +0000 |
commit | c9fbbbfdd7c97505ebea6b01e51029e98a08a863 (patch) | |
tree | dd9c43cded0d18ca332c331e28e4fdc1bd897d8a /src/game/g_main.c | |
parent | cd01b7da984dbc08cafb110ab33f432c6fe963f5 (diff) |
* (bug 3408) g_alienstage/g_humanstage dont trigger trigger_stage
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r-- | src/game/g_main.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c index 08d1b455..a11499f8 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1197,8 +1197,10 @@ G_CalculateStages */ void G_CalculateStages( void ) { - float alienPlayerCountMod = level.averageNumAlienClients / PLAYER_COUNT_MOD; - float humanPlayerCountMod = level.averageNumHumanClients / PLAYER_COUNT_MOD; + float alienPlayerCountMod = level.averageNumAlienClients / PLAYER_COUNT_MOD; + float humanPlayerCountMod = level.averageNumHumanClients / PLAYER_COUNT_MOD; + static int lastAlienStageModCount = 1; + static int lastHumanStageModCount = 1; if( alienPlayerCountMod < 0.1f ) alienPlayerCountMod = 0.1f; @@ -1213,6 +1215,7 @@ void G_CalculateStages( void ) G_Checktrigger_stages( PTE_ALIENS, S2 ); trap_Cvar_Set( "g_alienStage", va( "%d", S2 ) ); level.alienStage2Time = level.time; + lastAlienStageModCount = g_alienStage.modificationCount; } if( g_alienCredits.integer >= @@ -1222,6 +1225,7 @@ void G_CalculateStages( void ) G_Checktrigger_stages( PTE_ALIENS, S3 ); trap_Cvar_Set( "g_alienStage", va( "%d", S3 ) ); level.alienStage3Time = level.time; + lastAlienStageModCount = g_alienStage.modificationCount; } if( g_humanCredits.integer >= @@ -1231,6 +1235,7 @@ void G_CalculateStages( void ) G_Checktrigger_stages( PTE_HUMANS, S2 ); trap_Cvar_Set( "g_humanStage", va( "%d", S2 ) ); level.humanStage2Time = level.time; + lastHumanStageModCount = g_humanStage.modificationCount; } if( g_humanCredits.integer >= @@ -1240,6 +1245,31 @@ void G_CalculateStages( void ) G_Checktrigger_stages( PTE_HUMANS, S3 ); trap_Cvar_Set( "g_humanStage", va( "%d", S3 ) ); level.humanStage3Time = level.time; + lastHumanStageModCount = g_humanStage.modificationCount; + } + + if( g_alienStage.modificationCount > lastAlienStageModCount ) + { + G_Checktrigger_stages( PTE_ALIENS, g_alienStage.integer ); + + if( g_alienStage.integer == S2 ) + level.alienStage2Time = level.time; + else if( g_alienStage.integer == S3 ) + level.alienStage3Time = level.time; + + lastAlienStageModCount = g_alienStage.modificationCount; + } + + if( g_humanStage.modificationCount > lastHumanStageModCount ) + { + G_Checktrigger_stages( PTE_HUMANS, g_humanStage.integer ); + + if( g_humanStage.integer == S2 ) + level.humanStage2Time = level.time; + else if( g_humanStage.integer == S3 ) + level.humanStage3Time = level.time; + + lastHumanStageModCount = g_humanStage.modificationCount; } } |