mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-03 08:40:59 +00:00
MOHAWK: Fix background music restarting when changing cards in original Myst
This commit is contained in:
parent
c7f3a4f578
commit
efac5c42d7
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user