aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/kyra/lol.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 099f6ee866..ae435f4fb7 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -1203,9 +1203,10 @@ bool LoLEngine::snd_playCharacterSpeech(int id, int8 speaker, int) {
snprintf(pattern1, sizeof(pattern1), "@%04d", id - 1000);
}
- for (char i = '0'; i != -1; i++) {
- snprintf(file1, sizeof(file1), "%s%c%c.%s", pattern1, (char)speaker, i, pattern2);
- snprintf(file2, sizeof(file2), "%s%c%c.%s", pattern1, '_', i, pattern2);
+ for (char i = 0; ; i++) {
+ char symbol = '0' + i;
+ snprintf(file1, sizeof(file1), "%s%c%c.%s", pattern1, (char)speaker, symbol, pattern2);
+ snprintf(file2, sizeof(file2), "%s%c%c.%s", pattern1, '_', symbol, pattern2);
if (_res->exists(file1)) {
char *f = new char[strlen(file1) + 1];
strcpy(f, file1);
@@ -1215,7 +1216,7 @@ bool LoLEngine::snd_playCharacterSpeech(int id, int8 speaker, int) {
strcpy(f, file2);
playList.push_back(f);
} else {
- i = -2;
+ break;
}
}