From 52dcaa45fd9deacfb21367074be95be370e76afb Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Thu, 29 Sep 2005 22:53:31 +0000 Subject: [PATCH] * A better fix to the "doppler" bug --- code/client/snd_dma.c | 5 ++--- code/client/snd_local.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/client/snd_dma.c b/code/client/snd_dma.c index 2a99aae2..74af4473 100644 --- a/code/client/snd_dma.c +++ b/code/client/snd_dma.c @@ -780,9 +780,8 @@ void S_AddLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocit loopSounds[entityNum].dopplerScale = lenb/(lena*100); if (loopSounds[entityNum].dopplerScale<=1.0) { loopSounds[entityNum].doppler = qfalse; // don't bother doing the math - } - else if (loopSounds[entityNum].dopplerScale>(float)SND_CHUNK_SIZE) { - loopSounds[entityNum].dopplerScale = (float)SND_CHUNK_SIZE; + } else if (loopSounds[entityNum].dopplerScale>MAX_DOPPLER_SCALE) { + loopSounds[entityNum].dopplerScale = MAX_DOPPLER_SCALE; } } diff --git a/code/client/snd_local.h b/code/client/snd_local.h index da2d5db4..6131ad3f 100644 --- a/code/client/snd_local.h +++ b/code/client/snd_local.h @@ -72,6 +72,8 @@ typedef struct { #define START_SAMPLE_IMMEDIATE 0x7fffffff +#define MAX_DOPPLER_SCALE 50.0f //arbitrary + typedef struct loopSound_s { vec3_t origin; vec3_t velocity;