]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move sv_q3acompat_machineshotgunswap ammo swap from ammo.qc to quake3.qc
authorbones_was_here <bones_was_here@yahoo.com.au>
Sat, 11 Jul 2020 05:55:34 +0000 (15:55 +1000)
committerbones_was_here <bones_was_here@yahoo.com.au>
Sat, 11 Jul 2020 05:55:34 +0000 (15:55 +1000)
qcsrc/common/items/item/ammo.qc
qcsrc/server/compat/quake3.qc

index 527a7e6ef2de8497bc8d2e70deb6ec84f90c3df2..48ca0ddab6947f2dd320a96d5644983f4a055ee4 100644 (file)
@@ -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
index bf0a8beeb944f7f658d07f20c2f18c7cd8c520fd..05a956f9a755bb3ef1a1611f9057a077a408f51a 100644 (file)
 
 // 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)