From 6667fc91a5bdf755c2fa09d64c5495932cd30548 Mon Sep 17 00:00:00 2001 From: Samual Date: Fri, 30 Sep 2011 16:22:43 -0400 Subject: [PATCH] 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) --- qcsrc/server/cl_weaponsystem.qc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) 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; -- 2.39.2