aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBastien Bouclet2016-08-16 13:13:02 +0200
committerBastien Bouclet2016-08-16 13:18:00 +0200
commit09138c9e9ffb70e4831e9ca377632cdd13d4ec5e (patch)
tree47b5c119324741d01d5256316ef0186d09d13f5a /engines
parent87d9b6682ac1093995f43444c3d8dd915e968dc2 (diff)
downloadscummvm-rg350-09138c9e9ffb70e4831e9ca377632cdd13d4ec5e.tar.gz
scummvm-rg350-09138c9e9ffb70e4831e9ca377632cdd13d4ec5e.tar.bz2
scummvm-rg350-09138c9e9ffb70e4831e9ca377632cdd13d4ec5e.zip
MOHAWK: Fix setting the ambient sound volumes
A crash would occur when the number of ambient sound decreases while keeping the same base sound. Fixes #7184.
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/riven_sound.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/mohawk/riven_sound.cpp b/engines/mohawk/riven_sound.cpp
index dd45f94ad3..10a23a0719 100644
--- a/engines/mohawk/riven_sound.cpp
+++ b/engines/mohawk/riven_sound.cpp
@@ -200,7 +200,7 @@ void RivenSoundManager::addAmbientSounds(const SLSTRecord &record) {
}
void RivenSoundManager::setTargetVolumes(const SLSTRecord &record) {
- for (uint i = 0; i < _ambientSounds.sounds.size(); i++) {
+ for (uint i = 0; i < record.volumes.size(); i++) {
_ambientSounds.sounds[i].targetVolume = record.volumes[i] * record.globalVolume / 256;
_ambientSounds.sounds[i].targetBalance = record.balances[i];
}