From 06900457e46e4b47fe5fe871db104dcbe34ee44e Mon Sep 17 00:00:00 2001 From: Martin Taibr Date: Tue, 8 Oct 2019 20:55:58 +0200 Subject: [PATCH] make precedence explicit in arc code --- qcsrc/common/weapons/weapon/arc.qc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 5948d6a12..28bc84736 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -583,8 +583,9 @@ void Arc_Smoke(Weapon thiswep, entity actor, .entity weaponentity, int fire) Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 ); } - if ( actor.arc_smoke_sound && ( actor.arc_overheat <= time || - !( PHYS_INPUT_BUTTON_ATCK(actor) || PHYS_INPUT_BUTTON_ATCK2(actor) ) ) || actor.(weaponentity).m_switchweapon != thiswep ) + bool attacking = PHYS_INPUT_BUTTON_ATCK(actor) || PHYS_INPUT_BUTTON_ATCK2(actor); + bool stop_smoke_sound = actor.arc_overheat <= time || !attacking; + if ((actor.arc_smoke_sound && stop_smoke_sound) || actor.(weaponentity).m_switchweapon != thiswep) { actor.arc_smoke_sound = 0; sound(actor, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM); -- 2.39.2