]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_ctf.qc
gamemodes: prevent addition and removal at runtime with a single macro
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_ctf.qc
index 08162f7ab9b92920462e27b8d3312675e37c89f6..8e11e1d7890d61cfe3e53b0b40e9bf1abb2e6fd8 100644 (file)
@@ -6,30 +6,15 @@ void ctf_Initialize();
 
 REGISTER_MUTATOR(ctf, 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.");
                ctf_Initialize();
 
                GameRules_teams(true);
         GameRules_limit_score(autocvar_capturelimit_override);
         GameRules_limit_lead(autocvar_captureleadlimit_override);
        }
-
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back ctf_Initialize here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
-       }
-
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
-       }
-
        return 0;
 }
 #endif