From 43f899f2ce9a3e01832149240a4038aded583eb6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 24 Jun 2020 22:02:23 +0200 Subject: [PATCH] - 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. --- source/exhumed/src/sound.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/exhumed/src/sound.cpp b/source/exhumed/src/sound.cpp index 86512fd38..1ff7e3c05 100644 --- a/source/exhumed/src/sound.cpp +++ b/source/exhumed/src/sound.cpp @@ -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