aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/sound.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp
index 2428f1bdb0..6144c89e21 100644
--- a/engines/mohawk/sound.cpp
+++ b/engines/mohawk/sound.cpp
@@ -616,9 +616,16 @@ Audio::SoundHandle *Sound::replaceBackgroundMyst(uint16 id, uint16 volume) {
Common::String name = _vm->getResourceName(ID_MSND, convertMystID(id));
+ // Only the first eight characters need to be the same to have a match
+ Common::String prefix;
+ if (name.size() >= 8)
+ prefix = Common::String(name.c_str(), name.c_str() + 8);
+ else
+ prefix = name;
+
// Check if sound is already playing
if (_mystBackgroundSound.type == kUsedHandle && _vm->_mixer->isSoundHandleActive(_mystBackgroundSound.handle)
- && name.equals(_vm->getResourceName(ID_MSND, convertMystID(_mystBackgroundSound.id))))
+ && _vm->getResourceName(ID_MSND, convertMystID(_mystBackgroundSound.id)).hasPrefix(prefix))
return &_mystBackgroundSound.handle;
// Stop old background sound