From: Mario Date: Thu, 7 Mar 2013 06:04:03 +0000 (+1100) Subject: Add new MUTATOR_ONROLLBACK_OR_REMOVE stuff to td X-Git-Tag: xonotic-v0.8.0~241^2^2~463 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=aebd432b5af52a32e3cfaa13f0117007a8d35716;p=xonotic%2Fxonotic-data.pk3dir.git Add new MUTATOR_ONROLLBACK_OR_REMOVE stuff to td --- diff --git a/qcsrc/server/mutators/gamemode_towerdefense.qc b/qcsrc/server/mutators/gamemode_towerdefense.qc index eee62194f..cffba0a5c 100644 --- a/qcsrc/server/mutators/gamemode_towerdefense.qc +++ b/qcsrc/server/mutators/gamemode_towerdefense.qc @@ -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;