REGISTER_MUTATOR(inv, 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_invasion = true;
- invasion_Initialize();
-
- cvar_settemp("g_monsters", "1");
-
- GameRules_limit_score(autocvar_g_invasion_point_limit);
-
- if (autocvar_g_invasion_teams >= 2)
- {
+ if (autocvar_g_invasion_teams >= 2) {
GameRules_teams(true);
GameRules_spawning_teams(autocvar_g_invasion_team_spawns);
}
- }
-
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back invasion_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
+ GameRules_limit_score(autocvar_g_invasion_point_limit);
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
+ g_invasion = true;
+ cvar_settemp("g_monsters", "1");
+ invasion_Initialize();
}
-
return 0;
}