From c6919fbc0bc1a0b60d49893e38d3c924a6d64b1e Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 15 Oct 2015 01:14:02 +1000 Subject: [PATCH] Destroy another gamemode specific check --- qcsrc/server/miscfunctions.qh | 6 ++++-- qcsrc/server/mutators/events.qh | 2 ++ qcsrc/server/mutators/gamemode_assault.qc | 7 +++++++ qcsrc/server/mutators/gamemode_race.qc | 7 +++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/miscfunctions.qh b/qcsrc/server/miscfunctions.qh index 043f5b959..1c9dfe689 100644 --- a/qcsrc/server/miscfunctions.qh +++ b/qcsrc/server/miscfunctions.qh @@ -340,8 +340,8 @@ void readlevelcvars(void) g_warmup_allguns = cvar("g_warmup_allguns"); g_warmup_allow_timeout = cvar("g_warmup_allow_timeout"); - if ((g_race && g_race_qualifying == 2) || g_assault || cvar("g_campaign")) - warmup_stage = 0; // these modes cannot work together, sorry + if(cvar("g_campaign")) + warmup_stage = 0; // no warmup during campaign g_pickup_respawntime_weapon = cvar("g_pickup_respawntime_weapon"); g_pickup_respawntime_superweapon = cvar("g_pickup_respawntime_superweapon"); @@ -409,6 +409,8 @@ void readlevelcvars(void) if(!g_weapon_stay) g_weapon_stay = cvar("g_weapon_stay"); + MUTATOR_CALLHOOK(ReadLevelCvars); + if (!warmup_stage) game_starttime = time + cvar("g_start_delay"); diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index e446816e5..b9727c7e1 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -771,4 +771,6 @@ MUTATOR_HOOKABLE(DropSpecialItems, EV_DropSpecialItems); * return 1 to prevent spawning */ MUTATOR_HOOKABLE(AllowMobButcher, EV_NO_ARGS); + +MUTATOR_HOOKABLE(ReadLevelCvars, EV_NO_ARGS); #endif diff --git a/qcsrc/server/mutators/gamemode_assault.qc b/qcsrc/server/mutators/gamemode_assault.qc index 8df531915..e3a28e3c4 100644 --- a/qcsrc/server/mutators/gamemode_assault.qc +++ b/qcsrc/server/mutators/gamemode_assault.qc @@ -579,6 +579,13 @@ MUTATOR_HOOKFUNCTION(as, CheckRules_World) return true; } +MUTATOR_HOOKFUNCTION(as, ReadLevelCvars) +{ + // no assault warmups + warmup_stage = 0; + return false; +} + // scoreboard setup void assault_ScoreRules() { diff --git a/qcsrc/server/mutators/gamemode_race.qc b/qcsrc/server/mutators/gamemode_race.qc index 735bce7e0..b7c660a46 100644 --- a/qcsrc/server/mutators/gamemode_race.qc +++ b/qcsrc/server/mutators/gamemode_race.qc @@ -322,6 +322,13 @@ MUTATOR_HOOKFUNCTION(rc, CheckRules_World) return false; } +MUTATOR_HOOKFUNCTION(rc, ReadLevelCvars) +{ + if(g_race_qualifying == 2) + warmup_stage = 0; + return false; +} + void race_Initialize() { race_ScoreRules(); -- 2.39.2