aboutsummaryrefslogtreecommitdiffstats
path: root/code/client/snd_openal.c
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-01-24 21:23:21 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-01-24 21:23:21 +0000
commitf22191f25976f39d1467b6fd9e523fe96d900a7d (patch)
treef4384687e0aa0057b4c2c0f72701fb44a66a5ca6 /code/client/snd_openal.c
parent6d74e13451e79441dc45419d5a46f4fbf0256a98 (diff)
downloadioquake3-aero-f22191f25976f39d1467b6fd9e523fe96d900a7d.tar.gz
ioquake3-aero-f22191f25976f39d1467b6fd9e523fe96d900a7d.zip
- Fix loads of format string bugs
- Fix locally looping sounds, thanks to Timbo git-svn-id: svn://svn.icculus.org/quake3/trunk@1037 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/client/snd_openal.c')
-rw-r--r--code/client/snd_openal.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/code/client/snd_openal.c b/code/client/snd_openal.c
index 26628df..b20e411 100644
--- a/code/client/snd_openal.c
+++ b/code/client/snd_openal.c
@@ -530,15 +530,13 @@ Adapt the gain if necessary to get a quicker fadeout when the source is too far
static void S_AL_ScaleGain(src_t *chksrc, vec3_t origin)
{
float distance;
-
- if(chksrc->local)
- distance = VectorLength(origin);
- else
+
+ if(!chksrc->local)
distance = Distance(origin, lastListenerOrigin);
-
+
// If we exceed a certain distance, scale the gain linearly until the sound
// vanishes into nothingness.
- if((distance -= s_alMaxDistance->value) > 0)
+ if(!chksrc->local && (distance -= s_alMaxDistance->value) > 0)
{
float scaleFactor;