]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_tdm.qh
gamemodes: prevent addition and removal at runtime with a single macro
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_tdm.qh
index bfff9cca1beda3dcf3ec226f0064fea8b239ada9..28331dfefc625f1278d33dad334600a6cf44a8a6 100644 (file)
@@ -9,10 +9,9 @@ void tdm_DelayedInit(entity this);
 
 REGISTER_MUTATOR(tdm, 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.");
                InitializeEntity(NULL, tdm_DelayedInit, INITPRIO_GAMETYPE);
 
                GameRules_teams(true);
@@ -20,19 +19,5 @@ REGISTER_MUTATOR(tdm, false)
         GameRules_limit_lead(autocvar_g_tdm_point_leadlimit);
         GameRules_spawning_teams(autocvar_g_tdm_team_spawns);
        }
-
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back tdm_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;
 }