Skip to content

Commit 7d1935b

Browse files
Only play gunshot sounds once or twice
This helps cut down on gunshots quickly maxing out the sound channel count during fights. The tradeoff is that gunshots will sound quieter now, but I feel like this is worth it to avoid cutting off other sounds entirely.
1 parent 7a2771c commit 7d1935b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lua/effects/acf_muzzle_flash.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,8 @@ function EFFECT:Init(Data)
3535
-- NOTE: Wiki documents level tops out at 180, but seems to fall off past 127
3636
Sounds.PlaySound(GunPos, Sound, math.Clamp(SoundPressure, 75, 127), Pitch, Volume)
3737

38-
if not (Class == "MG" or Class == "RAC") then
39-
Sounds.PlaySound(GunPos, Sound, math.Clamp(SoundPressure, 75, 127), Pitch, Volume)
40-
41-
if SoundPressure > 127 then
42-
Sounds.PlaySound(GunPos, Sound, math.Clamp(SoundPressure - 127, 1, 127), Pitch, Volume)
43-
end
38+
if not (Class == "MG" or Class == "RAC") and SoundPressure > 127 then
39+
Sounds.PlaySound(GunPos, Sound, math.Clamp(SoundPressure - 127, 1, 127), Pitch, Volume)
4440
end
4541
end
4642

0 commit comments

Comments
 (0)