- Do not start multiple instances of the same sound on the same source in Exhumed.

From the looks of it the engine calls the sound function repeatedly while the sound plays to perform distance checks.
With the OpenAL backend these checks are totally unnecessary and shouldn't do anything.
This commit is contained in:
Christoph Oelckers 2020-06-24 22:02:23 +02:00
parent 8c723f52d1
commit 43f899f2ce

View file

@ -577,6 +577,7 @@ void PlayFX2(unsigned short nSound, short nSprite)
if (nSprite >= 0)
{
if (soundEngine->IsSourcePlayingSomething(SOURCE_Actor, &sprite[nSprite], CHAN_BODY, nSound + 1)) return;
soundEngine->StartSound(SOURCE_Actor, &sprite[nSprite], nullptr, CHAN_BODY, CHANF_OVERLAP, nSound+1, nVolume / 255.f, ATTN_NORM, nullptr, (11025 + nPitch) / 11025.f);
}
else