From: bones_was_here Date: Fri, 10 Jul 2020 11:44:10 +0000 (+1000) Subject: Replace bullets with shells when sv_q3acompat_machineshotgunswap is enabled X-Git-Tag: xonotic-v0.8.5~352^2~82 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5e7fc73cd0b59398775603836b2753b3a868abb7;p=xonotic%2Fxonotic-data.pk3dir.git Replace bullets with shells when sv_q3acompat_machineshotgunswap is enabled --- diff --git a/qcsrc/common/items/item/ammo.qc b/qcsrc/common/items/item/ammo.qc index 739d94aca..527a7e6ef 100644 --- a/qcsrc/common/items/item/ammo.qc +++ b/qcsrc/common/items/item/ammo.qc @@ -11,4 +11,13 @@ METHOD(Shells, m_spawnfunc_hookreplace, GameItem(Shells this, entity e)) 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