]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Survival: Updated to new game rules.
authorLyberta <lyberta@lyberta.net>
Mon, 28 Aug 2017 00:04:38 +0000 (03:04 +0300)
committerLyberta <lyberta@lyberta.net>
Mon, 28 Aug 2017 00:04:38 +0000 (03:04 +0300)
qcsrc/server/mutators/mutator/gamemode_survival.qc
qcsrc/server/mutators/mutator/gamemode_survival.qh

index b47660c62ab983912ef587684ed3d863852588a3..11593483631ba077a1d4c2dd65a2aa840290567e 100644 (file)
@@ -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.
index 93f997be4a70cf35f450db529b9e61144525a710..a4128c20ce2ebb9862f08f8c44bba65d9da045dd 100644 (file)
@@ -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;
 }