diff options
author | Zack Middleton <zturtleman@gmail.com> | 2012-10-17 19:30:41 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-12 20:48:53 +0000 |
commit | dcefbc80d07e9453dc8f1109687f6325960a6b48 (patch) | |
tree | efb6945ab4d7d30d655d96fb1b7ad6a795d964f4 /src | |
parent | f09e088270c4253a1619f661f665da9250c0cb99 (diff) |
Check last listener number instead of clc.clientNum in S_AL_HearingThroughEntity so sound work correctly when spectate following a client. (Related to bug 5741.)
Diffstat (limited to 'src')
-rw-r--r-- | src/client/snd_openal.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/snd_openal.c b/src/client/snd_openal.c index 88eaa0e9..ce669f1d 100644 --- a/src/client/snd_openal.c +++ b/src/client/snd_openal.c @@ -559,6 +559,7 @@ static src_t srcList[MAX_SRC]; static int srcCount = 0; static int srcActiveCnt = 0; static qboolean alSourcesInitialised = qfalse; +static int lastListenerNumber = -1; static vec3_t lastListenerOrigin = { 0.0f, 0.0f, 0.0f }; typedef struct sentity_s @@ -659,7 +660,7 @@ static qboolean S_AL_HearingThroughEntity( int entityNum ) { float distanceSq; - if( clc.clientNum == entityNum ) + if( lastListenerNumber == entityNum ) { // FIXME: <tim@ngus.net> 28/02/06 This is an outrageous hack to detect // whether or not the player is rendering in third person or not. We can't @@ -2170,6 +2171,7 @@ void S_AL_Respatialize( int entityNum, const vec3_t origin, vec3_t axis[3], int orientation[0] = axis[0][0]; orientation[1] = axis[0][1]; orientation[2] = axis[0][2]; orientation[3] = axis[2][0]; orientation[4] = axis[2][1]; orientation[5] = axis[2][2]; + lastListenerNumber = entityNum; VectorCopy( sorigin, lastListenerOrigin ); // Set OpenAL listener paramaters |