]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Only play strength sound if snd argument for W_SetupShot wasn't empty (This way it...
authorSamual <samual@xonotic.org>
Fri, 30 Sep 2011 20:22:43 +0000 (16:22 -0400)
committerSamual <samual@xonotic.org>
Fri, 30 Sep 2011 20:22:43 +0000 (16:22 -0400)
qcsrc/server/cl_weaponsystem.qc

index 095e839becc0f33602b9378d8a7bc0d90384b766..c843564e84aedbd18210d296e8fe5c694eb166cf 100644 (file)
@@ -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;