From: z411 Date: Mon, 15 Nov 2021 03:23:49 +0000 (-0300) Subject: Make CA/FT/LMS respect g_use_ammunition X-Git-Tag: xonotic-v0.8.5~295^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b6f8d526f5162264477d378aa6598103378caca1;p=xonotic%2Fxonotic-data.pk3dir.git Make CA/FT/LMS respect g_use_ammunition Makes it possible to play CA/FT/LMS with unlimited ammo. --- diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc index abdfe030e..99b2055a3 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc +++ b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc @@ -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"); diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index 11ddede9b..8cb056375 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@ -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"); diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index e9ddb4e81..b603a2bd8 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -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");