]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/gamemode_freezetag.qc
Mapinfo: decentralise mapinfo parsing
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_freezetag.qc
1 #include "gamemode_freezetag.qh"
2
3 #include "gamemode.qh"
4
5 float autocvar_g_freezetag_frozen_maxtime;
6 bool autocvar_g_freezetag_revive_nade;
7 float autocvar_g_freezetag_revive_nade_health;
8 int autocvar_g_freezetag_point_leadlimit;
9 int autocvar_g_freezetag_point_limit;
10 float autocvar_g_freezetag_revive_extra_size;
11 float autocvar_g_freezetag_revive_speed;
12 float autocvar_g_freezetag_revive_clearspeed;
13 float autocvar_g_freezetag_round_timelimit;
14 int autocvar_g_freezetag_teams;
15 int autocvar_g_freezetag_teams_override;
16 bool autocvar_g_freezetag_team_spawns;
17 float autocvar_g_freezetag_warmup;
18
19 const float SP_FREEZETAG_REVIVALS = 4;
20 void freezetag_ScoreRules(float teams)
21 {
22         ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true); // SFL_SORT_PRIO_PRIMARY
23         ScoreInfo_SetLabel_PlayerScore(SP_FREEZETAG_REVIVALS, "revivals", 0);
24         ScoreRules_basics_end();
25 }
26
27 void freezetag_count_alive_players()
28 {
29         entity e;
30         total_players = redalive = bluealive = yellowalive = pinkalive = 0;
31         FOR_EACH_PLAYER(e)
32         {
33                 switch(e.team)
34                 {
35                         case NUM_TEAM_1: ++total_players; if(e.health >= 1 && e.frozen != 1) ++redalive; break;
36                         case NUM_TEAM_2: ++total_players; if(e.health >= 1 && e.frozen != 1) ++bluealive; break;
37                         case NUM_TEAM_3: ++total_players; if(e.health >= 1 && e.frozen != 1) ++yellowalive; break;
38                         case NUM_TEAM_4: ++total_players; if(e.health >= 1 && e.frozen != 1) ++pinkalive; break;
39                 }
40         }
41         FOR_EACH_REALCLIENT(e)
42         {
43                 e.redalive_stat = redalive;
44                 e.bluealive_stat = bluealive;
45                 e.yellowalive_stat = yellowalive;
46                 e.pinkalive_stat = pinkalive;
47         }
48
49         eliminatedPlayers.SendFlags |= 1;
50 }
51 #define FREEZETAG_ALIVE_TEAMS() ((redalive > 0) + (bluealive > 0) + (yellowalive > 0) + (pinkalive > 0))
52 #define FREEZETAG_ALIVE_TEAMS_OK() (FREEZETAG_ALIVE_TEAMS() == freezetag_teams)
53
54 float freezetag_CheckTeams()
55 {
56         static float prev_missing_teams_mask;
57         if(FREEZETAG_ALIVE_TEAMS_OK())
58         {
59                 if(prev_missing_teams_mask > 0)
60                         Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_MISSING_TEAMS);
61                 prev_missing_teams_mask = -1;
62                 return 1;
63         }
64         if(total_players == 0)
65         {
66                 if(prev_missing_teams_mask > 0)
67                         Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_MISSING_TEAMS);
68                 prev_missing_teams_mask = -1;
69                 return 0;
70         }
71         float missing_teams_mask = (!redalive) + (!bluealive) * 2;
72         if(freezetag_teams >= 3) missing_teams_mask += (!yellowalive) * 4;
73         if(freezetag_teams >= 4) missing_teams_mask += (!pinkalive) * 8;
74         if(prev_missing_teams_mask != missing_teams_mask)
75         {
76                 Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask);
77                 prev_missing_teams_mask = missing_teams_mask;
78         }
79         return 0;
80 }
81
82 float freezetag_getWinnerTeam()
83 {
84         float winner_team = 0;
85         if(redalive >= 1)
86                 winner_team = NUM_TEAM_1;
87         if(bluealive >= 1)
88         {
89                 if(winner_team) return 0;
90                 winner_team = NUM_TEAM_2;
91         }
92         if(yellowalive >= 1)
93         {
94                 if(winner_team) return 0;
95                 winner_team = NUM_TEAM_3;
96         }
97         if(pinkalive >= 1)
98         {
99                 if(winner_team) return 0;
100                 winner_team = NUM_TEAM_4;
101         }
102         if(winner_team)
103                 return winner_team;
104         return -1; // no player left
105 }
106
107 float freezetag_CheckWinner()
108 {
109         entity e;
110         if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
111         {
112                 Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
113                 Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
114                 FOR_EACH_PLAYER(e)
115                 {
116                         e.freezetag_frozen_timeout = 0;
117                         nades_Clear(e);
118                 }
119                 round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
120                 return 1;
121         }
122
123         if(FREEZETAG_ALIVE_TEAMS() > 1)
124                 return 0;
125
126         float winner_team;
127         winner_team = freezetag_getWinnerTeam();
128         if(winner_team > 0)
129         {
130                 Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM_4(winner_team, CENTER_ROUND_TEAM_WIN_));
131                 Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(winner_team, INFO_ROUND_TEAM_WIN_));
132                 TeamScore_AddToTeam(winner_team, ST_SCORE, +1);
133         }
134         else if(winner_team == -1)
135         {
136                 Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED);
137                 Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED);
138         }
139
140         FOR_EACH_PLAYER(e)
141         {
142                 e.freezetag_frozen_timeout = 0;
143                 nades_Clear(e);
144         }
145         round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
146         return 1;
147 }
148
149 entity freezetag_LastPlayerForTeam()
150 {SELFPARAM();
151         entity pl, last_pl = world;
152         FOR_EACH_PLAYER(pl)
153         {
154                 if(pl.health >= 1)
155                 if(!pl.frozen)
156                 if(pl != self)
157                 if(pl.team == self.team)
158                 if(!last_pl)
159                         last_pl = pl;
160                 else
161                         return world;
162         }
163         return last_pl;
164 }
165
166 void freezetag_LastPlayerForTeam_Notify()
167 {
168         if(round_handler_IsActive())
169         if(round_handler_IsRoundStarted())
170         {
171                 entity pl = freezetag_LastPlayerForTeam();
172                 if(pl)
173                         Send_Notification(NOTIF_ONE, pl, MSG_CENTER, CENTER_ALONE);
174         }
175 }
176
177 void freezetag_Add_Score(entity attacker)
178 {SELFPARAM();
179         if(attacker == self)
180         {
181                 // you froze your own dumb self
182                 // counted as "suicide" already
183                 PlayerScore_Add(self, SP_SCORE, -1);
184         }
185         else if(IS_PLAYER(attacker))
186         {
187                 // got frozen by an enemy
188                 // counted as "kill" and "death" already
189                 PlayerScore_Add(self, SP_SCORE, -1);
190                 PlayerScore_Add(attacker, SP_SCORE, +1);
191         }
192         // else nothing - got frozen by the game type rules themselves
193 }
194
195 void freezetag_Freeze(entity attacker)
196 {SELFPARAM();
197         if(self.frozen)
198                 return;
199
200         if(autocvar_g_freezetag_frozen_maxtime > 0)
201                 self.freezetag_frozen_timeout = time + autocvar_g_freezetag_frozen_maxtime;
202
203         Freeze(self, 0, 1, true);
204
205         freezetag_count_alive_players();
206
207         freezetag_Add_Score(attacker);
208 }
209
210 void freezetag_Unfreeze(entity attacker)
211 {SELFPARAM();
212         self.freezetag_frozen_time = 0;
213         self.freezetag_frozen_timeout = 0;
214
215         Unfreeze(self);
216 }
217
218 float freezetag_isEliminated(entity e)
219 {
220         if(IS_PLAYER(e) && (e.frozen == 1 || e.deadflag != DEAD_NO))
221                 return true;
222         return false;
223 }
224
225
226 // ================
227 // Bot player logic
228 // ================
229
230 void() havocbot_role_ft_freeing;
231 void() havocbot_role_ft_offense;
232
233 void havocbot_goalrating_freeplayers(float ratingscale, vector org, float sradius)
234 {SELFPARAM();
235         entity head;
236         float distance;
237
238         FOR_EACH_PLAYER(head)
239         {
240                 if ((head != self) && (head.team == self.team))
241                 {
242                         if (head.frozen == 1)
243                         {
244                                 distance = vlen(head.origin - org);
245                                 if (distance > sradius)
246                                         continue;
247                                 navigation_routerating(head, ratingscale, 2000);
248                         }
249                         else
250                         {
251                                 // If teamate is not frozen still seek them out as fight better
252                                 // in a group.
253                                 navigation_routerating(head, ratingscale/3, 2000);
254                         }
255                 }
256         }
257 }
258
259 void havocbot_role_ft_offense()
260 {SELFPARAM();
261         entity head;
262         float unfrozen;
263
264         if(self.deadflag != DEAD_NO)
265                 return;
266
267         if (!self.havocbot_role_timeout)
268                 self.havocbot_role_timeout = time + random() * 10 + 20;
269
270         // Count how many players on team are unfrozen.
271         unfrozen = 0;
272         FOR_EACH_PLAYER(head)
273         {
274                 if ((head.team == self.team) && (head.frozen != 1))
275                         unfrozen++;
276         }
277
278         // If only one left on team or if role has timed out then start trying to free players.
279         if (((unfrozen == 0) && (!self.frozen)) || (time > self.havocbot_role_timeout))
280         {
281                 LOG_TRACE("changing role to freeing\n");
282                 self.havocbot_role = havocbot_role_ft_freeing;
283                 self.havocbot_role_timeout = 0;
284                 return;
285         }
286
287         if (time > self.bot_strategytime)
288         {
289                 self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
290
291                 navigation_goalrating_start();
292                 havocbot_goalrating_items(10000, self.origin, 10000);
293                 havocbot_goalrating_enemyplayers(20000, self.origin, 10000);
294                 havocbot_goalrating_freeplayers(9000, self.origin, 10000);
295                 //havocbot_goalrating_waypoints(1, self.origin, 1000);
296                 navigation_goalrating_end();
297         }
298 }
299
300 void havocbot_role_ft_freeing()
301 {SELFPARAM();
302         if(self.deadflag != DEAD_NO)
303                 return;
304
305         if (!self.havocbot_role_timeout)
306                 self.havocbot_role_timeout = time + random() * 10 + 20;
307
308         if (time > self.havocbot_role_timeout)
309         {
310                 LOG_TRACE("changing role to offense\n");
311                 self.havocbot_role = havocbot_role_ft_offense;
312                 self.havocbot_role_timeout = 0;
313                 return;
314         }
315
316         if (time > self.bot_strategytime)
317         {
318                 self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
319
320                 navigation_goalrating_start();
321                 havocbot_goalrating_items(8000, self.origin, 10000);
322                 havocbot_goalrating_enemyplayers(10000, self.origin, 10000);
323                 havocbot_goalrating_freeplayers(20000, self.origin, 10000);
324                 //havocbot_goalrating_waypoints(1, self.origin, 1000);
325                 navigation_goalrating_end();
326         }
327 }
328
329
330 // ==============
331 // Hook Functions
332 // ==============
333
334 void ft_RemovePlayer()
335 {SELFPARAM();
336         self.health = 0; // neccessary to update correctly alive stats
337         if(!self.frozen)
338                 freezetag_LastPlayerForTeam_Notify();
339         freezetag_Unfreeze(world);
340         freezetag_count_alive_players();
341 }
342
343 MUTATOR_HOOKFUNCTION(ft, ClientDisconnect)
344 {SELFPARAM();
345         ft_RemovePlayer();
346         return 1;
347 }
348
349 MUTATOR_HOOKFUNCTION(ft, MakePlayerObserver)
350 {SELFPARAM();
351         ft_RemovePlayer();
352         return false;
353 }
354
355 MUTATOR_HOOKFUNCTION(ft, PlayerDies)
356 {SELFPARAM();
357         if(round_handler_IsActive())
358         if(round_handler_CountdownRunning())
359         {
360                 if(self.frozen)
361                         freezetag_Unfreeze(world);
362                 freezetag_count_alive_players();
363                 return 1; // let the player die so that he can respawn whenever he wants
364         }
365
366         // Cases DEATH_TEAMCHANGE and DEATH_AUTOTEAMCHANGE are needed to fix a bug whe
367         // you succeed changing team through the menu: you both really die (gibbing) and get frozen
368         if(ITEM_DAMAGE_NEEDKILL(frag_deathtype)
369                 || frag_deathtype == DEATH_TEAMCHANGE.m_id || frag_deathtype == DEATH_AUTOTEAMCHANGE.m_id)
370         {
371                 // let the player die, he will be automatically frozen when he respawns
372                 if(self.frozen != 1)
373                 {
374                         freezetag_Add_Score(frag_attacker);
375                         freezetag_count_alive_players();
376                         freezetag_LastPlayerForTeam_Notify();
377                 }
378                 else
379                         freezetag_Unfreeze(world); // remove ice
380                 self.health = 0; // Unfreeze resets health
381                 self.freezetag_frozen_timeout = -2; // freeze on respawn
382                 return 1;
383         }
384
385         if(self.frozen)
386                 return 1;
387
388         freezetag_Freeze(frag_attacker);
389         freezetag_LastPlayerForTeam_Notify();
390
391         if(frag_attacker == frag_target || frag_attacker == world)
392         {
393                 if(IS_PLAYER(frag_target))
394                         Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_SELF);
395                 Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_SELF, frag_target.netname);
396         }
397         else
398         {
399                 if(IS_PLAYER(frag_target))
400                         Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_FROZEN, frag_attacker.netname);
401                 if(IS_PLAYER(frag_attacker))
402                         Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_FREEZETAG_FREEZE, frag_target.netname);
403                 Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_FREEZE, frag_target.netname, frag_attacker.netname);
404         }
405
406         return 1;
407 }
408
409 MUTATOR_HOOKFUNCTION(ft, PlayerSpawn)
410 {SELFPARAM();
411         if(self.freezetag_frozen_timeout == -1) // if PlayerSpawn is called by reset_map_players
412                 return 1; // do nothing, round is starting right now
413
414         if(self.freezetag_frozen_timeout == -2) // player was dead
415         {
416                 freezetag_Freeze(world);
417                 return 1;
418         }
419
420         freezetag_count_alive_players();
421
422         if(round_handler_IsActive())
423         if(round_handler_IsRoundStarted())
424         {
425                 Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_FREEZETAG_SPAWN_LATE);
426                 freezetag_Freeze(world);
427         }
428
429         return 1;
430 }
431
432 MUTATOR_HOOKFUNCTION(ft, reset_map_players)
433 {SELFPARAM();
434         entity e;
435         FOR_EACH_PLAYER(e)
436         {
437                 e.killcount = 0;
438                 e.freezetag_frozen_timeout = -1;
439                 setself(e);
440                 PutClientInServer();
441                 e.freezetag_frozen_timeout = 0;
442         }
443         freezetag_count_alive_players();
444         return 1;
445 }
446
447 MUTATOR_HOOKFUNCTION(ft, GiveFragsForKill, CBC_ORDER_FIRST)
448 {
449         frag_score = 0; // no frags counted in Freeze Tag
450         return 1;
451 }
452
453 MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
454 {SELFPARAM();
455         float n;
456
457         if(gameover)
458                 return 1;
459
460         if(self.frozen == 1)
461         {
462                 // keep health = 1
463                 self.pauseregen_finished = time + autocvar_g_balance_pause_health_regen;
464         }
465
466         if(round_handler_IsActive())
467         if(!round_handler_IsRoundStarted())
468                 return 1;
469
470         entity o;
471         o = world;
472         //if(self.frozen)
473         //if(self.freezetag_frozen_timeout > 0 && time < self.freezetag_frozen_timeout)
474                 //self.iceblock.alpha = ICE_MIN_ALPHA + (ICE_MAX_ALPHA - ICE_MIN_ALPHA) * (self.freezetag_frozen_timeout - time) / (self.freezetag_frozen_timeout - self.freezetag_frozen_time);
475
476         if(self.freezetag_frozen_timeout > 0 && time >= self.freezetag_frozen_timeout)
477                 n = -1;
478         else
479         {
480                 vector revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
481                 n = 0;
482                 FOR_EACH_PLAYER(other)
483                 if(self != other)
484                 if(other.frozen == 0)
485                 if(other.deadflag == DEAD_NO)
486                 if(SAME_TEAM(other, self))
487                 if(boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax))
488                 {
489                         if(!o)
490                                 o = other;
491                         if(self.frozen == 1)
492                                 other.reviving = true;
493                         ++n;
494                 }
495         }
496
497         if(n && self.frozen == 1) // OK, there is at least one teammate reviving us
498         {
499                 self.revive_progress = bound(0, self.revive_progress + frametime * max(1/60, autocvar_g_freezetag_revive_speed), 1);
500                 self.health = max(1, self.revive_progress * ((warmup_stage) ? warmup_start_health : start_health));
501
502                 if(self.revive_progress >= 1)
503                 {
504                         freezetag_Unfreeze(self);
505                         freezetag_count_alive_players();
506
507                         if(n == -1)
508                         {
509                                 Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_FREEZETAG_AUTO_REVIVED, autocvar_g_freezetag_frozen_maxtime);
510                                 Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_AUTO_REVIVED, self.netname, autocvar_g_freezetag_frozen_maxtime);
511                                 return 1;
512                         }
513
514                         // EVERY team mate nearby gets a point (even if multiple!)
515                         FOR_EACH_PLAYER(other)
516                         {
517                                 if(other.reviving)
518                                 {
519                                         PlayerScore_Add(other, SP_FREEZETAG_REVIVALS, +1);
520                                         PlayerScore_Add(other, SP_SCORE, +1);
521
522                                         nades_GiveBonus(other,autocvar_g_nades_bonus_score_low);
523                                 }
524                         }
525
526                         Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_FREEZETAG_REVIVED, o.netname);
527                         Send_Notification(NOTIF_ONE, o, MSG_CENTER, CENTER_FREEZETAG_REVIVE, self.netname);
528                         Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED, self.netname, o.netname);
529                 }
530
531                 FOR_EACH_PLAYER(other)
532                 {
533                         if(other.reviving)
534                         {
535                                 other.revive_progress = self.revive_progress;
536                                 other.reviving = false;
537                         }
538                 }
539         }
540         else if(!n && self.frozen == 1) // only if no teammate is nearby will we reset
541         {
542                 self.revive_progress = bound(0, self.revive_progress - frametime * autocvar_g_freezetag_revive_clearspeed, 1);
543                 self.health = max(1, self.revive_progress * ((warmup_stage) ? warmup_start_health : start_health));
544         }
545         else if(!n && !self.frozen)
546         {
547                 self.revive_progress = 0; // thawing nobody
548         }
549
550         return 1;
551 }
552
553 MUTATOR_HOOKFUNCTION(ft, SetStartItems)
554 {
555         start_items &= ~IT_UNLIMITED_AMMO;
556         //start_health       = warmup_start_health       = cvar("g_lms_start_health");
557         //start_armorvalue   = warmup_start_armorvalue   = cvar("g_lms_start_armor");
558         start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_lms_start_ammo_shells");
559         start_ammo_nails   = warmup_start_ammo_nails   = cvar("g_lms_start_ammo_nails");
560         start_ammo_rockets = warmup_start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
561         start_ammo_cells   = warmup_start_ammo_cells   = cvar("g_lms_start_ammo_cells");
562         start_ammo_plasma  = warmup_start_ammo_plasma  = cvar("g_lms_start_ammo_plasma");
563         start_ammo_fuel    = warmup_start_ammo_fuel    = cvar("g_lms_start_ammo_fuel");
564
565         return 0;
566 }
567
568 MUTATOR_HOOKFUNCTION(ft, HavocBot_ChooseRole)
569 {SELFPARAM();
570         if (!self.deadflag)
571         {
572                 if (random() < 0.5)
573                         self.havocbot_role = havocbot_role_ft_freeing;
574                 else
575                         self.havocbot_role = havocbot_role_ft_offense;
576         }
577
578         return true;
579 }
580
581 MUTATOR_HOOKFUNCTION(ft, GetTeamCount, CBC_ORDER_EXCLUSIVE)
582 {
583         ret_float = freezetag_teams;
584         return false;
585 }
586
587 MUTATOR_HOOKFUNCTION(ft, SetWeaponArena)
588 {
589         // most weapons arena
590         if(ret_string == "0" || ret_string == "")
591                 ret_string = "most";
592         return false;
593 }
594
595 void freezetag_Initialize()
596 {
597         freezetag_teams = autocvar_g_freezetag_teams_override;
598         if(freezetag_teams < 2)
599                 freezetag_teams = autocvar_g_freezetag_teams;
600         freezetag_teams = bound(2, freezetag_teams, 4);
601         freezetag_ScoreRules(freezetag_teams);
602
603         round_handler_Spawn(freezetag_CheckTeams, freezetag_CheckWinner, func_null);
604         round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
605
606         addstat(STAT_REDALIVE, AS_INT, redalive_stat);
607         addstat(STAT_BLUEALIVE, AS_INT, bluealive_stat);
608         addstat(STAT_YELLOWALIVE, AS_INT, yellowalive_stat);
609         addstat(STAT_PINKALIVE, AS_INT, pinkalive_stat);
610
611         EliminatedPlayers_Init(freezetag_isEliminated);
612 }
613
614 REGISTER_MUTATOR(ft, g_freezetag)
615 {
616         ActivateTeamplay();
617         SetLimits(autocvar_g_freezetag_point_limit, autocvar_g_freezetag_point_leadlimit, -1, -1);
618
619         if(autocvar_g_freezetag_team_spawns)
620                 have_team_spawns = -1; // request team spawns
621
622         MUTATOR_ONADD
623         {
624                 if(time > 1) // game loads at time 1
625                         error("This is a game type and it cannot be added at runtime.");
626                 freezetag_Initialize();
627         }
628
629         MUTATOR_ONROLLBACK_OR_REMOVE
630         {
631                 // we actually cannot roll back freezetag_Initialize here
632                 // BUT: we don't need to! If this gets called, adding always
633                 // succeeds.
634         }
635
636         MUTATOR_ONREMOVE
637         {
638                 LOG_INFO("This is a game type and it cannot be removed at runtime.");
639                 return -1;
640         }
641
642         return 0;
643 }