diff options
-rw-r--r-- | engines/xeen/scripts.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp index 9e04fd1252..be567236a9 100644 --- a/engines/xeen/scripts.cpp +++ b/engines/xeen/scripts.cpp @@ -1374,7 +1374,7 @@ bool Scripts::cmdDisplayBottomTwoLines(ParamsIterator ¶ms) { bool Scripts::cmdDisplayLarge(ParamsIterator ¶ms) { Party &party = *g_vm->_party; Common::String filename = Common::String::format("aaze2%03u.txt", party._mazeId); - uint offset = params.readByte(); + uint lineNumber = params.readByte(); // Get the text data for the current maze File f(filename); @@ -1382,8 +1382,11 @@ bool Scripts::cmdDisplayLarge(ParamsIterator ¶ms) { f.read(data, f.size()); f.close(); - // Get the message at the specified offset - _message = Common::String(data + offset); + // Get the message at the specified line + const char *lineP = data; + for (uint idx = 0; idx < lineNumber; ++idx, lineP += strlen(lineP) + 1) {} + + _message = Common::String(lineP); delete[] data; // Display the message |