diff --git a/docs/rh-log.txt b/docs/rh-log.txt index fdb2dcbd1e..b400d677ed 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ November 3, 2009 +- Fixed: S_RestartSound() cleared the evicted flag even if the sound + was not restarted because it was too close to too many other identical + sounds that were already playing. - Added virtual status and audibility to the noise debug display. - Added a command line option -warpwipe to perform the screen wipe if you start with -warp or +map. diff --git a/src/s_sound.cpp b/src/s_sound.cpp index ffacab9e64..1287873a59 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -250,7 +250,7 @@ void S_NoiseDebug (void) screen->DrawText(SmallFont, color, 380, y, temp, TAG_DONE); // Audibility - mysnprintf(temp, countof(temp), "%.2g", GSnd->GetAudibility(chan)); + mysnprintf(temp, countof(temp), "%.4f", GSnd->GetAudibility(chan)); screen->DrawText(SmallFont, color, 460, y, temp, TAG_DONE); y += 8; @@ -1125,7 +1125,6 @@ void S_RestartSound(FSoundChan *chan) if (chan->ChanFlags & (CHAN_UI|CHAN_NOPAUSE)) startflags |= SNDF_NOPAUSE; if (chan->ChanFlags & CHAN_ABSTIME) startflags |= SNDF_ABSTIME; - chan->ChanFlags &= ~(CHAN_EVICTED|CHAN_ABSTIME); if (chan->ChanFlags & CHAN_IS3D) { FVector3 pos, vel; @@ -1142,11 +1141,13 @@ void S_RestartSound(FSoundChan *chan) SoundListener listener; S_SetListener(listener, players[consoleplayer].camera); + chan->ChanFlags &= ~(CHAN_EVICTED|CHAN_ABSTIME); ochan = (FSoundChan*)GSnd->StartSound3D(sfx->data, &listener, chan->Volume, &chan->Rolloff, chan->DistanceScale, chan->Pitch, chan->Priority, pos, vel, chan->EntChannel, startflags, chan); } else { + chan->ChanFlags &= ~(CHAN_EVICTED|CHAN_ABSTIME); ochan = (FSoundChan*)GSnd->StartSound(sfx->data, chan->Volume, chan->Pitch, startflags, chan); } assert(ochan == NULL || ochan == chan);