]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_ca.qh
gamemodes: prevent addition and removal at runtime with a single macro
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_ca.qh
index 5a4a9f8438ead67bbb81d9a0d47e73f5ac9c72ee..bf4a453a3bf9d4fadbce34403be210ff8c3773c0 100644 (file)
@@ -23,11 +23,9 @@ bool ca_isEliminated(entity e);
 
 REGISTER_MUTATOR(ca, false)
 {
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               // game loads at time 1
-               if (time > 1) error("This is a game type and it cannot be added at runtime.");
-
                allowed_to_spawn = true;
 
                ca_teams = autocvar_g_ca_teams_override;
@@ -50,13 +48,6 @@ REGISTER_MUTATOR(ca, false)
 
         GameRules_spawning_teams(autocvar_g_ca_team_spawns);
        }
-
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
-       }
-
        return 0;
 }