From c3ba6d00e64baab511510addd36cf03b64d64e24 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 27 Dec 2019 17:08:48 +0100 Subject: [PATCH] - fixed: forgettable channels must not be tested for sound limits because they no longer have a valid source. --- source/common/sound/s_sound.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/common/sound/s_sound.cpp b/source/common/sound/s_sound.cpp index f00db6fcf..16b153287 100644 --- a/source/common/sound/s_sound.cpp +++ b/source/common/sound/s_sound.cpp @@ -885,6 +885,7 @@ bool SoundEngine::CheckSoundLimit(sfxinfo_t *sfx, const FVector3 &pos, int near_ for (chan = Channels, count = 0; chan != NULL && count < near_limit; chan = chan->NextChan) { + if (chan->ChanFlags & CHANF_FORGETTABLE) continue; if (!(chan->ChanFlags & CHANF_EVICTED) && &S_sfx[chan->SoundID] == sfx) { FVector3 chanorigin; @@ -1426,6 +1427,7 @@ void SoundEngine::StopChannel(FSoundChan *chan) if (chan->SourceType == SOURCE_Actor) { chan->Source = NULL; + chan->SourceType = SOURCE_Unattached; } } if (GSnd) GSnd->StopChannel(chan);