From 5684d9f02c5bc2c587349896cd8d8db8ce2a83df Mon Sep 17 00:00:00 2001 From: Lyberta Date: Mon, 28 Aug 2017 03:04:38 +0300 Subject: [PATCH] Survival: Updated to new game rules. --- .../mutators/mutator/gamemode_survival.qc | 6 +++--- .../mutators/mutator/gamemode_survival.qh | 19 +------------------ 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/qcsrc/server/mutators/mutator/gamemode_survival.qc b/qcsrc/server/mutators/mutator/gamemode_survival.qc index b47660c62a..1159348363 100644 --- a/qcsrc/server/mutators/mutator/gamemode_survival.qc +++ b/qcsrc/server/mutators/mutator/gamemode_survival.qc @@ -242,9 +242,9 @@ void Surv_Initialize() round_handler_Spawn(Surv_CanRoundStart, Surv_CanRoundEnd, Surv_RoundStart); round_handler_Init(5, autocvar_g_surv_warmup, surv_timetobeat); EliminatedPlayers_Init(Surv_IsEliminated); - ActivateTeamplay(); - SetLimits(autocvar_g_surv_point_limit, autocvar_g_surv_point_leadlimit, - autocvar_timelimit_override, -1); + GameRules_teams(true); + GameRules_limit_score(autocvar_g_surv_point_limit); + GameRules_limit_lead(autocvar_g_surv_point_leadlimit); } /// \brief Returns the name of the template of the given player. diff --git a/qcsrc/server/mutators/mutator/gamemode_survival.qh b/qcsrc/server/mutators/mutator/gamemode_survival.qh index 93f997be4a..a4128c20ce 100644 --- a/qcsrc/server/mutators/mutator/gamemode_survival.qh +++ b/qcsrc/server/mutators/mutator/gamemode_survival.qh @@ -8,27 +8,10 @@ void Surv_Initialize(); REGISTER_MUTATOR(surv, false) { + MUTATOR_STATIC(); MUTATOR_ONADD { - if (time > 1) // game loads at time 1 - { - error("This is a game type and it cannot be added at runtime."); - } Surv_Initialize(); } - - MUTATOR_ONROLLBACK_OR_REMOVE - { - // we actually cannot roll back dm_Initialize here - // BUT: we don't need to! If this gets called, adding always - // succeeds. - } - - MUTATOR_ONREMOVE - { - error("This is a game type and it cannot be removed at runtime."); - return -1; - } - return 0; } -- 2.39.5