From 3825019a2d277984bc78b4dfd45c87578331176b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Severin=20Paul=20H=C3=B6fer?= <84280965+zzril@users.noreply.github.com> Date: Sat, 28 Dec 2024 18:28:48 +0100 Subject: [PATCH] Re-create sound channel only for looping sounds This partly reverts b264a732472f5643437ddfd51c80df98285c6c7e and ensures that non-looping sounds (e. g. guests screams) do not get replayed until their condition becomes false and then true again. --- src/openrct2-ui/ride/VehicleSounds.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/ride/VehicleSounds.cpp b/src/openrct2-ui/ride/VehicleSounds.cpp index 477e7e0a62..6e5ec4a89a 100644 --- a/src/openrct2-ui/ride/VehicleSounds.cpp +++ b/src/openrct2-ui/ride/VehicleSounds.cpp @@ -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;