From 0661314c2ac14c80d44aca73a8a849d519c735ef Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sat, 11 Jul 2020 15:55:34 +1000 Subject: [PATCH] Move sv_q3acompat_machineshotgunswap ammo swap from ammo.qc to quake3.qc --- qcsrc/common/items/item/ammo.qc | 21 --------------------- qcsrc/server/compat/quake3.qc | 8 ++++---- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/qcsrc/common/items/item/ammo.qc b/qcsrc/common/items/item/ammo.qc index 527a7e6ef..48ca0ddab 100644 --- a/qcsrc/common/items/item/ammo.qc +++ b/qcsrc/common/items/item/ammo.qc @@ -1,23 +1,2 @@ #include "ammo.qh" -#ifdef SVQC - -METHOD(Shells, m_spawnfunc_hookreplace, GameItem(Shells this, entity e)) -{ - if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e)) - { - return ITEM_Bullets; - } - return this; -} - -METHOD(Bullets, m_spawnfunc_hookreplace, GameItem(Bullets this, entity e)) -{ - if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e)) - { - return ITEM_Shells; - } - return this; -} - -#endif diff --git a/qcsrc/server/compat/quake3.qc b/qcsrc/server/compat/quake3.qc index bf0a8beeb..05a956f9a 100644 --- a/qcsrc/server/compat/quake3.qc +++ b/qcsrc/server/compat/quake3.qc @@ -17,11 +17,11 @@ // NOTE: for best experience, you need to swap MGs with SGs in the map or it won't have a MG -// SG -> SG -SPAWNFUNC_ITEM(ammo_shells, ITEM_Shells) +// SG -> MG || SG +SPAWNFUNC_ITEM_COND(ammo_shells, autocvar_sv_q3acompat_machineshotgunswap, ITEM_Bullets, ITEM_Shells) -// MG -> MG -SPAWNFUNC_ITEM(ammo_bullets, ITEM_Bullets) +// MG -> SG || MG +SPAWNFUNC_ITEM_COND(ammo_bullets, autocvar_sv_q3acompat_machineshotgunswap, ITEM_Shells, ITEM_Bullets) // GL -> Mortar SPAWNFUNC_ITEM(ammo_grenades, ITEM_Rockets) -- 2.39.2