From 82ab36d1b4c5e08c76c0822cc76fce6fa5ed2cf7 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 21 Oct 2016 11:24:56 +1000 Subject: [PATCH] Check for matching switchweapon when auto firing arc and hagar --- qcsrc/common/weapons/weapon/arc.qc | 2 ++ qcsrc/common/weapons/weapon/hagar.qc | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index a61dc0f03..576976357 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -340,6 +340,8 @@ void W_Arc_Beam_Think(entity this) || forbidWeaponUse(this.owner) || + PS(this.owner).m_switchweapon != WEP_ARC + || (!PHYS_INPUT_BUTTON_ATCK(this.owner) && !burst ) || this.owner.vehicle diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index 9a178c03b..097f2bfdc 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -310,7 +310,7 @@ void W_Hagar_Attack2_Load(Weapon thiswep, entity actor, .entity weaponentity) { // loadable hagar secondary attack, must always run each frame - if(time < game_starttime) + if(time < game_starttime || PS(actor).m_switchweapon != WEP_HAGAR) return; bool loaded = actor.hagar_load >= WEP_CVAR_SEC(hagar, load_max); @@ -416,7 +416,7 @@ void W_Hagar_Attack2_Load(Weapon thiswep, entity actor, .entity weaponentity) void W_Hagar_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity, int fire) { - if(!(fire & 1) || actor.hagar_load || actor.hagar_loadblock) + if(!(fire & 1) || actor.hagar_load || actor.hagar_loadblock || PS(actor).m_switchweapon != WEP_HAGAR) { w_ready(thiswep, actor, weaponentity, fire); return; -- 2.39.2