From a0156cdaf60f8d4e4ec8b5bb604be77218d11cbd Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sat, 13 Oct 2007 23:51:06 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1355 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/sound.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/src/sound.cpp b/source/src/sound.cpp index 5f633900..1cbe59fb 100644 --- a/source/src/sound.cpp +++ b/source/src/sound.cpp @@ -326,6 +326,8 @@ void updatevol() #endif } +VARP(maxsoundsatonce, 0, 5, 100); + void playsound(int n, const vec *loc, entity *ent) { if(nosound) return; @@ -336,7 +338,7 @@ void playsound(int n, const vec *loc, entity *ent) static int soundsatonce = 0, lastsoundmillis = 0; if(totalmillis==lastsoundmillis) soundsatonce++; else soundsatonce = 1; lastsoundmillis = totalmillis; - if(soundsatonce>5) return; // avoid bursts of sounds with heavy packetloss and in sp + if(maxsoundsatonce && soundsatonce>maxsoundsatonce) return; // avoid bursts of sounds with heavy packetloss and in sp } vector &sounds = ent ? mapsounds : gamesounds;