]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add new MUTATOR_ONROLLBACK_OR_REMOVE stuff to td
authorMario <mario.mario@y7mail.com>
Thu, 7 Mar 2013 06:04:03 +0000 (17:04 +1100)
committerMario <mario.mario@y7mail.com>
Thu, 7 Mar 2013 06:04:03 +0000 (17:04 +1100)
qcsrc/server/mutators/gamemode_towerdefense.qc

index eee62194fe9759291cccb556d9132019268e8c21..cffba0a5c545cc7fad0b1eb3c898b037b8743d1d 100644 (file)
@@ -641,7 +641,7 @@ void td_DelayedInit()
        td_ScoreRules();
 }
 
-void td_Init()
+void td_Initialize()
 {
        InitializeEntity(world, td_DelayedInit, INITPRIO_GAMETYPE);
 }
@@ -1083,12 +1083,20 @@ MUTATOR_DEFINITION(gamemode_td)
                        error("This is a game type and it cannot be added at runtime.");        
                cvar_settemp("g_monsters", "1");
                cvar_settemp("g_turrets", "1");
-               td_Init();
+               td_Initialize();
+       }
+       
+       MUTATOR_ONROLLBACK_OR_REMOVE
+       {
+               // we actually cannot roll back td_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 FALSE;