]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
make precedence explicit in arc code
authorMartin Taibr <taibr.martin@gmail.com>
Tue, 8 Oct 2019 18:55:58 +0000 (20:55 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Tue, 8 Oct 2019 18:55:58 +0000 (20:55 +0200)
qcsrc/common/weapons/weapon/arc.qc

index 5948d6a12e2831e0fcaf2f340cd7ae781ee72ce7..28bc8473694740c4c1223f96debd7d5a0c03eee6 100644 (file)
@@ -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);