Index: code/client/snd_openal.c =================================================================== --- code/client/snd_openal.c (revision 2312) +++ code/client/snd_openal.c (working copy) @@ -541,6 +541,7 @@ static int srcActiveCnt = 0; static qboolean alSourcesInitialised = qfalse; static vec3_t lastListenerOrigin = { 0.0f, 0.0f, 0.0f }; +static int lastListenerNumber; typedef struct sentity_s { @@ -638,27 +639,7 @@ */ static qboolean S_AL_HearingThroughEntity( int entityNum ) { - float distanceSq; - - if( clc.clientNum == entityNum ) - { - // FIXME: 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 - // ask the renderer because the renderer has no notion of entities and we - // can't ask cgame since that would involve changing the API and hence mod - // compatibility. I don't think there is any way around this, but I'll leave - // the FIXME just in case anyone has a bright idea. - distanceSq = DistanceSquared( - entityList[ entityNum ].origin, - lastListenerOrigin ); - - if( distanceSq > AL_THIRD_PERSON_THRESHOLD_SQ ) - return qfalse; //we're the player, but third person - else - return qtrue; //we're the player - } - else - return qfalse; //not the player + return (entityNum == lastListenerNumber) ? qtrue : qfalse; } /* @@ -2141,6 +2122,7 @@ float orientation[6]; vec3_t sorigin; + lastListenerNumber = entityNum; VectorCopy( origin, sorigin ); S_AL_SanitiseVector( sorigin );