From: bones_was_here Date: Sat, 11 Jul 2020 05:55:34 +0000 (+1000) Subject: Move sv_q3acompat_machineshotgunswap ammo swap from ammo.qc to quake3.qc X-Git-Tag: xonotic-v0.8.5~352^2~77 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0661314c2ac14c80d44aca73a8a849d519c735ef;p=xonotic%2Fxonotic-data.pk3dir.git Move sv_q3acompat_machineshotgunswap ammo swap from ammo.qc to quake3.qc --- 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)