diff options
author | Willem Jan Palenstijn | 2014-10-07 21:24:49 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-02-15 13:57:03 +0100 |
commit | 5964cc239b920a4a5d3b8475cb6c0b111e968e03 (patch) | |
tree | 76c334fe1802bda79f467dfb67fca7c7ffd9bcb2 /engines/sci/engine/savegame.cpp | |
parent | 58ef44eb8d9d3eb78eb013441a8d6d12940ee5e3 (diff) | |
download | scummvm-rg350-5964cc239b920a4a5d3b8475cb6c0b111e968e03.tar.gz scummvm-rg350-5964cc239b920a4a5d3b8475cb6c0b111e968e03.tar.bz2 scummvm-rg350-5964cc239b920a4a5d3b8475cb6c0b111e968e03.zip |
SCI: Always re-sort playlist in soundPlay
Previously, it would only sort if a song wasn't already in the playlist.
Since initSound already adds it, this effectively prevented the list
from being sorted.
Diffstat (limited to 'engines/sci/engine/savegame.cpp')
-rw-r--r-- | engines/sci/engine/savegame.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 692fa77a80..eee4c49729 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -639,8 +639,12 @@ void SoundCommandParser::syncPlayList(Common::Serializer &s) { void SoundCommandParser::reconstructPlayList() { Common::StackLock lock(_music->_mutex); - const MusicList::iterator end = _music->getPlayListEnd(); - for (MusicList::iterator i = _music->getPlayListStart(); i != end; ++i) { + // We store all songs here because starting songs may re-shuffle their order + MusicList songs; + for (MusicList::iterator i = _music->getPlayListStart(); i != _music->getPlayListEnd(); ++i) + songs.push_back(*i); + + for (MusicList::iterator i = songs.begin(); i != songs.end(); ++i) { initSoundResource(*i); if ((*i)->status == kSoundPlaying) { |