]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/mutator/gamemode_lms.qh
Show to spectators all the waypoints that are shown to spectated players. It fixes...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_lms.qh
1 #pragma once
2
3 #include "../gamemode.qh"
4
5 #define autocvar_g_lms_lives_override cvar("g_lms_lives_override")
6 void lms_Initialize();
7
8 REGISTER_MUTATOR(lms, 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                 lms_Initialize();
15
16                 SetLimits(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override), 0, autocvar_timelimit_override, -1);
17         }
18
19         MUTATOR_ONROLLBACK_OR_REMOVE
20         {
21                 // we actually cannot roll back lms_Initialize here
22                 // BUT: we don't need to! If this gets called, adding always
23                 // succeeds.
24         }
25
26         MUTATOR_ONREMOVE
27         {
28                 LOG_INFO("This is a game type and it cannot be removed at runtime.");
29                 return -1;
30         }
31
32         return 0;
33 }
34
35 // lives related defs
36 float lms_lowest_lives;
37 float lms_next_place;
38 float LMS_NewPlayerLives();