forked from rosebudai/OpenRCT2-Web
Merge pull request #23490 from zzril/fix-#19780-guest-screams-loop
Fix #19780: Guest screams loop on long drops
This commit is contained in:
3 files changed
+9
-4
No files matched your search
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user