]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_cts.qh
gamemodes: prevent addition and removal at runtime with a single macro
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_cts.qh
index f81ed274aed1608aaef2facd20383e6bcb9c526e..c90919e6f4e7ed176c2740a63c6a4bb9c10575c8 100644 (file)
@@ -7,11 +7,9 @@ void cts_Initialize();
 
 REGISTER_MUTATOR(cts, 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.");
-
                g_race_qualifying = true;
                independent_players = 1;
         GameRules_limit_score(0);
@@ -19,20 +17,6 @@ REGISTER_MUTATOR(cts, false)
 
                cts_Initialize();
        }
-
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back cts_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;
 }