From 6cd1db9629bfdf7f8e38d020501f76af39efe126 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 31 Aug 2019 02:37:51 +1000 Subject: [PATCH] Fix sv_q3acompat_machineshotgunswap --- qcsrc/common/weapons/weapon/machinegun.qc | 9 --------- qcsrc/common/weapons/weapon/shockwave.qc | 3 +++ qcsrc/common/weapons/weapon/shotgun.qc | 9 +++++++++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index 2d88a9deb..aaf4900fe 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -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; diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index cdd0a0f92..94f84ba5b 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -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 diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index a3bf16145..22c928841 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -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); -- 2.39.2