X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Farc.qc;h=1090ce81d6c6cfc9639588d04131db5b594a4d13;hp=838d2aa8a86359c9600a0013b9ba90c608c9375f;hb=90d9f7c775306324957323d53d5a4ad995d999e3;hpb=2ccfbaf3d871db94af3195383a57ff738abaa07a;ds=sidebyside diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 838d2aa8a8..1090ce81d6 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); @@ -897,10 +898,7 @@ void Draw_ArcBeam(entity this) MAKE_VECTORS(myviewangle, forward, right, up); entity wepent = viewmodels[this.beam_slot]; - if(autocvar_chase_active) - this.beam_usevieworigin = 1; - else - this.beam_usevieworigin = 2; + this.beam_usevieworigin = (autocvar_chase_active) ? 1 : 2; // decide upon start position if(this.beam_usevieworigin == 2) @@ -1231,10 +1229,7 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew) if(ReadByte()) { - if(autocvar_chase_active) - { this.beam_usevieworigin = 1; } - else // use view origin - { this.beam_usevieworigin = 2; } + this.beam_usevieworigin = (autocvar_chase_active) ? 1 : 2; } else {