diff options
author | Paul Gilbert | 2019-08-28 19:58:31 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-08-28 20:07:32 -0700 |
commit | 2c5237db7e0d4f2fd887ec8dd65e881fedeacb7d (patch) | |
tree | 2b971cb64298314b79af7f2777c7b55475d7ead4 /engines/xeen/scripts.cpp | |
parent | 749480f2e0a0f43d4c5c5d9f2847705aa4593d22 (diff) | |
download | scummvm-rg350-2c5237db7e0d4f2fd887ec8dd65e881fedeacb7d.tar.gz scummvm-rg350-2c5237db7e0d4f2fd887ec8dd65e881fedeacb7d.tar.bz2 scummvm-rg350-2c5237db7e0d4f2fd887ec8dd65e881fedeacb7d.zip |
XEEN: Parameter to cmdDisplayLarge is line number, not offset
Diffstat (limited to 'engines/xeen/scripts.cpp')
-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 |