- fixed: forgettable channels must not be tested for sound limits because they no longer have a valid source.

This commit is contained in:
Christoph Oelckers 2019-12-27 17:08:48 +01:00
parent 6b0711ff0c
commit c3ba6d00e6

View file

@ -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) 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) if (!(chan->ChanFlags & CHANF_EVICTED) && &S_sfx[chan->SoundID] == sfx)
{ {
FVector3 chanorigin; FVector3 chanorigin;
@ -1426,6 +1427,7 @@ void SoundEngine::StopChannel(FSoundChan *chan)
if (chan->SourceType == SOURCE_Actor) if (chan->SourceType == SOURCE_Actor)
{ {
chan->Source = NULL; chan->Source = NULL;
chan->SourceType = SOURCE_Unattached;
} }
} }
if (GSnd) GSnd->StopChannel(chan); if (GSnd) GSnd->StopChannel(chan);