aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/sound_lol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/kyra/sound_lol.cpp')
-rw-r--r--engines/kyra/sound_lol.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp
index efa844968d..968488eef3 100644
--- a/engines/kyra/sound_lol.cpp
+++ b/engines/kyra/sound_lol.cpp
@@ -98,12 +98,12 @@ bool LoLEngine::snd_playCharacterSpeech(int id, int8 speaker, int) {
_speechList = newSpeechList;
_activeVoiceFileTotalTime = 0;
- for (SpeechList::iterator i = _speechList.begin(); i != _speechList.end(); ++i) {
+ for (SpeechList::iterator i = _speechList.begin(); i != _speechList.end();) {
// Just in case any file loading failed: Remove the bad streams here.
if (!*i)
i = _speechList.erase(i);
else
- _activeVoiceFileTotalTime += (*i)->getLength().msecs();
+ _activeVoiceFileTotalTime += (*i++)->getLength().msecs();
}
_sound->playVoiceStream(*_speechList.begin(), &_speechHandle);