1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Re-create sound channel only for looping sounds

This partly reverts b264a73247 and
ensures that non-looping sounds (e. g. guests screams) do not get
replayed until their condition becomes false and then true again.
This commit is contained in:
Severin Paul Höfer
2024-12-28 18:28:48 +01:00
parent c925ae26c1
commit 3825019a2d

View File

@@ -469,7 +469,7 @@ namespace OpenRCT2::Audio
volume = volume / 8;
volume = std::max(volume - 0x1FFF, -10000);
if (sound.Channel != nullptr && sound.Channel->IsDone())
if (sound.Channel != nullptr && sound.Channel->IsDone() && IsLoopingSound(sound.Id))
{
sound.Id = SoundId::Null;
sound.Channel = nullptr;