]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/mutator/gamemode_cts.qh
Merge branch 'master' into Mirio/balance
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_cts.qh
1 #pragma once
2
3 #include "../gamemode.qh"
4 #include <server/race.qh>
5
6 void cts_Initialize();
7
8 REGISTER_MUTATOR(cts, false)
9 {
10         MUTATOR_ONADD
11         {
12                 if (time > 1) // game loads at time 1
13                         error("This is a game type and it cannot be added at runtime.");
14
15                 g_race_qualifying = true;
16                 independent_players = 1;
17                 SetLimits(0, 0, autocvar_timelimit_override, -1);
18
19                 cts_Initialize();
20         }
21
22         MUTATOR_ONROLLBACK_OR_REMOVE
23         {
24                 // we actually cannot roll back cts_Initialize here
25                 // BUT: we don't need to! If this gets called, adding always
26                 // succeeds.
27         }
28
29         MUTATOR_ONREMOVE
30         {
31                 LOG_INFO("This is a game type and it cannot be removed at runtime.");
32                 return -1;
33         }
34
35         return 0;
36 }
37
38 // scores
39 const float ST_CTS_LAPS = 1;