From: Martin Taibr Date: Tue, 8 Oct 2019 18:55:58 +0000 (+0200) Subject: make precedence explicit in arc code X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=06900457e46e4b47fe5fe871db104dcbe34ee44e;p=xonotic%2Fxonotic-data.pk3dir.git make precedence explicit in arc code --- 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);