From: Mario Date: Fri, 30 Aug 2019 16:37:51 +0000 (+1000) Subject: Fix sv_q3acompat_machineshotgunswap X-Git-Tag: xonotic-v0.8.5~1343 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6cd1db9629bfdf7f8e38d020501f76af39efe126;p=xonotic%2Fxonotic-data.pk3dir.git Fix sv_q3acompat_machineshotgunswap --- 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);