aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorWalter van Niftrik2009-10-11 03:40:11 +0000
committerWalter van Niftrik2009-10-11 03:40:11 +0000
commitf2db73e55d2e3eda8b7f746ae8483f4f474d121a (patch)
treedf27cfcd5f185323459b210579d584ba6ec5a6f8 /engines/sci/engine
parentb2a148e12c49043855775f414249d49f5ee78b59 (diff)
downloadscummvm-rg350-f2db73e55d2e3eda8b7f746ae8483f4f474d121a.tar.gz
scummvm-rg350-f2db73e55d2e3eda8b7f746ae8483f4f474d121a.tar.bz2
scummvm-rg350-f2db73e55d2e3eda8b7f746ae8483f4f474d121a.zip
SCI: Fix bug in Message() recursion
svn-id: r44890
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/message.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp
index cfd7de6c46..b7e0c00fbe 100644
--- a/engines/sci/engine/message.cpp
+++ b/engines/sci/engine/message.cpp
@@ -182,9 +182,9 @@ bool MessageState::getRecord(CursorStack &stack, bool recurse, MessageRecord &re
if (recurse) {
MessageTuple &ref = record.refTuple;
- if ((ref.noun != 0) && (ref.verb != 0) && (ref.cond != 0)) {
+ if (ref.noun || ref.verb || ref.cond) {
t.seq++;
- stack.push(MessageTuple(ref.noun, ref.verb, ref.cond));
+ stack.push(ref);
continue;
}
}
@@ -202,16 +202,14 @@ int MessageState::nextMessage(reg_t buf) {
MessageRecord record;
if (!buf.isNull()) {
- MessageTuple &t = _cursorStack.top();
- Common::String finalStr;
-
if (getRecord(_cursorStack, true, record)) {
outputString(buf, processString(record.string));
_lastReturned = record.tuple;
_lastReturnedModule = _cursorStack.getModule();
- t.seq++;
+ _cursorStack.top().seq++;
return record.talker;
} else {
+ MessageTuple &t = _cursorStack.top();
outputString(buf, Common::String::printf("Msg %d: %d %d %d %d not found", _cursorStack.getModule(), t.noun, t.verb, t.cond, t.seq));
return 0;
}