From c925ae26c1de53e30693605d9e263ba4707df219 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:39:20 +0100 Subject: [PATCH 1/3] Rename Sub6D7AC0 to VehicleSoundFadeInOut --- src/openrct2/ride/Vehicle.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index bb31fd209f..8dfa7c7be1 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1185,7 +1185,11 @@ struct SoundIdVolume uint8_t volume; }; -static SoundIdVolume Sub6D7AC0( +/** + * + * rct2: 0x006D7AC0 + */ +static SoundIdVolume VehicleSoundFadeInOut( OpenRCT2::Audio::SoundId currentSoundId, uint8_t currentVolume, OpenRCT2::Audio::SoundId targetSoundId, uint8_t targetVolume) { @@ -4919,12 +4923,12 @@ void Vehicle::UpdateSound() } // Friction sound - auto soundIdVolume = Sub6D7AC0(sound1_id, sound1_volume, frictionSound.id, frictionSound.volume); + auto soundIdVolume = VehicleSoundFadeInOut(sound1_id, sound1_volume, frictionSound.id, frictionSound.volume); sound1_id = soundIdVolume.id; sound1_volume = soundIdVolume.volume; // Scream sound - soundIdVolume = Sub6D7AC0(sound2_id, sound2_volume, screamSound.id, screamSound.volume); + soundIdVolume = VehicleSoundFadeInOut(sound2_id, sound2_volume, screamSound.id, screamSound.volume); sound2_id = soundIdVolume.id; sound2_volume = soundIdVolume.volume; 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 2/3] 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; From ab8c163d8e66d322ce06692ee08206c08c48567f 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:52:51 +0100 Subject: [PATCH 3/3] Update changelog.txt --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 04b98f1abf..0610ece6b0 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -8,6 +8,7 @@ - Improved: [#23431] Opaque water and Corkscrew Roller Coaster boosters now show up if RCT1 isn’t linked. - Change: [#23413] The max number of park entrance objects has been raised to 255. - Fix: [#1122] Trains spawned on a cable lift hill will fall down and crash (original bug). +- Fix: [#19780] Guest screams loop on long drops. - Fix: [#22742, #22793] In game console does not handle format tokens properly. - Fix: [#23135] Map generator tree placement has noticable patterns. - Fix: [#23286] Currency formatted incorrectly in the in game console.