]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make CA/FT/LMS respect g_use_ammunition
authorz411 <z411@omaera.org>
Mon, 15 Nov 2021 03:23:49 +0000 (00:23 -0300)
committerz411 <z411@omaera.org>
Mon, 15 Nov 2021 03:23:49 +0000 (00:23 -0300)
Makes it possible to play CA/FT/LMS with unlimited ammo.

qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc
qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc

index abdfe030eebd088fba76fc219b1acc73e04a0501..99b2055a3bf4b5fa29dbe0d98e9fe0e0813ff076 100644 (file)
@@ -328,6 +328,9 @@ MUTATOR_HOOKFUNCTION(ca, GiveFragsForKill, CBC_ORDER_FIRST)
 MUTATOR_HOOKFUNCTION(ca, SetStartItems)
 {
        start_items       &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
+       if(!cvar("g_use_ammunition"))
+               start_items |= IT_UNLIMITED_AMMO;
+
        start_health       = warmup_start_health       = cvar("g_ca_start_health");
        start_armorvalue   = warmup_start_armorvalue   = cvar("g_ca_start_armor");
        start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_ca_start_ammo_shells");
index 11ddede9bae54f00de654056800560297f784b34..8cb056375624d9d5c9e5ed6238813e0b6631fd1d 100644 (file)
@@ -695,6 +695,9 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
 MUTATOR_HOOKFUNCTION(ft, SetStartItems)
 {
        start_items &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
+       if(!cvar("g_use_ammunition"))
+               start_items |= IT_UNLIMITED_AMMO;
+
        start_health       = warmup_start_health       = cvar("g_ft_start_health");
        start_armorvalue   = warmup_start_armorvalue   = cvar("g_ft_start_armor");
        start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_ft_start_ammo_shells");
index e9ddb4e815ef2a10344f2e0cd11c4aeb17d86d6c..b603a2bd81da44054a4006056ad080fc9cc2349a 100644 (file)
@@ -393,6 +393,9 @@ MUTATOR_HOOKFUNCTION(lms, GiveFragsForKill)
 MUTATOR_HOOKFUNCTION(lms, SetStartItems)
 {
        start_items &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
+       if(!cvar("g_use_ammunition"))
+               start_items |= IT_UNLIMITED_AMMO;
+
        start_health       = warmup_start_health       = cvar("g_lms_start_health");
        start_armorvalue   = warmup_start_armorvalue   = cvar("g_lms_start_armor");
        start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_lms_start_ammo_shells");