From: Samual Date: Fri, 30 Sep 2011 20:22:43 +0000 (-0400) Subject: Only play strength sound if snd argument for W_SetupShot wasn't empty (This way it... X-Git-Tag: xonotic-v0.6.0~40^2~92^2~1^2~14 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=6667fc91a5bdf755c2fa09d64c5495932cd30548;p=xonotic%2Fxonotic-data.pk3dir.git Only play strength sound if snd argument for W_SetupShot wasn't empty (This way it isn't broken for weapons like shotgun which play the sound elsewhere) --- diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 095e839be..c843564e8 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -241,20 +241,22 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m ent.punchangle_x = recoil * -1; if (snd != "") + { sound (ent, chan, snd, VOL_BASE, ATTN_NORM); - if(ent.items & IT_STRENGTH) - if(!g_minstagib) - if( - (time > ent.prevstrengthsound + autocvar_sv_strengthsound_antispam_time) - || - (time > ent.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold) - ) // prevent insane sound spam - { - sound(ent, CH_TRIGGER, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM); - ent.prevstrengthsound = time; + if(ent.items & IT_STRENGTH) + if(!g_minstagib) + if( + (time > ent.prevstrengthsound + autocvar_sv_strengthsound_antispam_time) + || + (time > ent.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold) + ) // prevent insane sound spam + { + sound(ent, CH_TRIGGER, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM); + ent.prevstrengthsound = time; + } + ent.prevstrengthsoundattempt = time; } - ent.prevstrengthsoundattempt = time; // nudge w_shotend so a trace to w_shotend hits w_shotend = w_shotend + normalize(w_shotend - w_shotorg) * nudge;