From ee786b36799718badfd7c192bdc72b5787ec68c2 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sat, 11 Jul 2020 16:54:07 +1000 Subject: [PATCH] Move sv_q3acompat_machineshotgunswap weapon_shotgun swap from shotgun.qc to quake3.qc --- qcsrc/common/weapons/weapon/shotgun.qc | 11 +---------- qcsrc/common/weapons/weapon/shotgun.qh | 1 - qcsrc/server/compat/quake3.qc | 1 + 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index b8cae5fd5..9b1c81f31 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -5,15 +5,6 @@ // enable to debug melee range //#define SHOTGUN_MELEEDEBUG -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); @@ -27,7 +18,7 @@ void W_Shotgun_Attack(Weapon thiswep, entity actor, .entity weaponentity, float for(int sc = 0;sc < bullets;sc = sc + 1) fireBullet_antilag(actor, weaponentity, w_shotorg, w_shotdir, spread, solidpenetration, damage, force, thiswep.m_id, bullet_trail_effect, false); - + if(lag && bullets > 0) antilag_restore_all(actor); diff --git a/qcsrc/common/weapons/weapon/shotgun.qh b/qcsrc/common/weapons/weapon/shotgun.qh index dc6dae157..25bc9123d 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qh +++ b/qcsrc/common/weapons/weapon/shotgun.qh @@ -54,4 +54,3 @@ CLASS(Shotgun, Weapon) ENDCLASS(Shotgun) REGISTER_WEAPON(SHOTGUN, shotgun, NEW(Shotgun)); -SPAWNFUNC_WEAPON(weapon_shotgun, WEP_SHOTGUN) diff --git a/qcsrc/server/compat/quake3.qc b/qcsrc/server/compat/quake3.qc index 05a956f9a..280b62897 100644 --- a/qcsrc/server/compat/quake3.qc +++ b/qcsrc/server/compat/quake3.qc @@ -19,6 +19,7 @@ // SG -> MG || SG SPAWNFUNC_ITEM_COND(ammo_shells, autocvar_sv_q3acompat_machineshotgunswap, ITEM_Bullets, ITEM_Shells) +SPAWNFUNC_WEAPON_COND(weapon_shotgun, autocvar_sv_q3acompat_machineshotgunswap, WEP_MACHINEGUN, WEP_SHOTGUN) // MG -> SG || MG SPAWNFUNC_ITEM_COND(ammo_bullets, autocvar_sv_q3acompat_machineshotgunswap, ITEM_Shells, ITEM_Bullets) -- 2.39.2