]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Replace bullets with shells when sv_q3acompat_machineshotgunswap is enabled
authorbones_was_here <bones_was_here@yahoo.com.au>
Fri, 10 Jul 2020 11:44:10 +0000 (21:44 +1000)
committerbones_was_here <bones_was_here@yahoo.com.au>
Fri, 10 Jul 2020 11:44:10 +0000 (21:44 +1000)
qcsrc/common/items/item/ammo.qc

index 739d94aca1e8b3fb9954ce8a278570f96c6363cf..527a7e6ef2de8497bc8d2e70deb6ec84f90c3df2 100644 (file)
@@ -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