From: Mario Date: Fri, 21 Oct 2016 01:24:56 +0000 (+1000) Subject: Check for matching switchweapon when auto firing arc and hagar X-Git-Tag: xonotic-v0.8.2~486 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=82ab36d1b4c5e08c76c0822cc76fce6fa5ed2cf7;p=xonotic%2Fxonotic-data.pk3dir.git Check for matching switchweapon when auto firing arc and hagar --- 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;