]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix sv_q3acompat_machineshotgunswap
authorMario <mario@smbclan.net>
Fri, 30 Aug 2019 16:37:51 +0000 (02:37 +1000)
committerMario <mario@smbclan.net>
Fri, 30 Aug 2019 16:37:51 +0000 (02:37 +1000)
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/shotgun.qc

index 2d88a9deb29fc65189487f9006d34ee6fcba2751..aaf4900fe2e683029c66ccd93c2ae932c2bae3ec 100644 (file)
@@ -2,15 +2,6 @@
 
 #ifdef SVQC
 
-METHOD(MachineGun, m_spawnfunc_hookreplace, Weapon(MachineGun this, entity e))
-{
-       if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
-       {
-               return WEP_SHOCKWAVE;
-       }
-       return this;
-}
-
 void W_MachineGun_MuzzleFlash_Think(entity this)
 {
        this.frame += 2;
index cdd0a0f92a315ecf1b3e774aa21b93ea17a5edfb..94f84ba5b1b8a88fa13b78e7c7afc7aed9f703a8 100644 (file)
@@ -3,6 +3,8 @@
 REGISTER_NET_TEMP(TE_CSQC_SHOCKWAVEPARTICLE)
 
 #ifdef SVQC
+// enable when shockwave replaces shotgun
+#if 0
 METHOD(Shockwave, m_spawnfunc_hookreplace, Weapon(Shockwave this, entity e))
 {
        //if(autocvar_sv_q3acompat_machineshockwaveswap) // WEAPONTODO
@@ -12,6 +14,7 @@ METHOD(Shockwave, m_spawnfunc_hookreplace, Weapon(Shockwave this, entity e))
        }
        return this;
 }
+#endif
 
 const float MAX_SHOCKWAVE_HITS = 10;
 //#define DEBUG_SHOCKWAVE
index a3bf16145ac438c8e5cc9d9150e0a9646f86379b..22c9288415f7636b6df39cd67277afc5c4d91022 100644 (file)
@@ -2,6 +2,15 @@
 
 #ifdef SVQC
 
+METHOD(Shotgun, m_spawnfunc_hookreplace, Weapon(Shotgun this, entity e))
+{
+       if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
+       {
+               return WEP_MACHINEGUN;
+       }
+       return this;
+}
+
 void W_Shotgun_Attack(Weapon thiswep, entity actor, .entity weaponentity, float isprimary, float ammocount, float damage, float bullets, float spread, float solidpenetration, float force, entity bullet_trail_effect)
 {
        W_DecreaseAmmo(thiswep, actor, ammocount, weaponentity);