diff options
author | sluicebox | 2019-06-16 02:57:34 -0700 |
---|---|---|
committer | sluicebox | 2019-06-16 02:57:34 -0700 |
commit | 5bb9174ad7a594a1884d3c5646146153c91ffdbb (patch) | |
tree | 98f88cb7ed8ef77bfd167dfdfacbc6e90c00bb88 | |
parent | 3d299df77344fc580e17fd613fda9dfefc6c585f (diff) | |
download | scummvm-rg350-5bb9174ad7a594a1884d3c5646146153c91ffdbb.tar.gz scummvm-rg350-5bb9174ad7a594a1884d3c5646146153c91ffdbb.tar.bz2 scummvm-rg350-5bb9174ad7a594a1884d3c5646146153c91ffdbb.zip |
SCI: Fix regression in message workarounds
Reverts an unintended change to the message recursion loop introduced in
56ea963cea3cdf04c44d3d6f545df664f4a27e8d that breaks the message stack
-rw-r--r-- | engines/sci/engine/message.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp index 0688b1ad12..dbb936263e 100644 --- a/engines/sci/engine/message.cpp +++ b/engines/sci/engine/message.cpp @@ -245,7 +245,7 @@ bool MessageState::getRecord(CursorStack &stack, bool recurse, MessageRecord &re } else if (workaround.type == MSG_WORKAROUND_FAKE) { // return a fake message record hard-coded in the workaround. // this leaves the stack unchanged. - record.tuple = stack.top(); + record.tuple = tuple; record.refTuple = MessageTuple(); record.string = workaround.text; record.length = strlen(workaround.text); @@ -262,7 +262,7 @@ bool MessageState::getRecord(CursorStack &stack, bool recurse, MessageRecord &re if (reader->findRecord(textTuple, textRecord)) { uint32 textLength = (workaround.substringLength == 0) ? textRecord.length : workaround.substringLength; if (workaround.substringIndex + textLength <= textRecord.length) { - record.tuple = stack.top(); + record.tuple = tuple; record.refTuple = MessageTuple(); record.string = textRecord.string + workaround.substringIndex; record.length = textLength; @@ -274,9 +274,9 @@ bool MessageState::getRecord(CursorStack &stack, bool recurse, MessageRecord &re } while (1) { - tuple = stack.top(); + MessageTuple &t = stack.top(); - if (!reader->findRecord(tuple, record)) { + if (!reader->findRecord(t, record)) { // Tuple not found if (recurse && (stack.size() > 1)) { stack.pop(); @@ -291,7 +291,7 @@ bool MessageState::getRecord(CursorStack &stack, bool recurse, MessageRecord &re MessageTuple &ref = record.refTuple; if (ref.noun || ref.verb || ref.cond) { - tuple.seq++; + t.seq++; stack.push(ref); continue; } |