Skip to content

Commit

Permalink
SHERLOCK: Fix regression in conversations
Browse files Browse the repository at this point in the history
This causes replies to once again be shown in their entirety,
instead of one line at a time.

There were two errors: First of all, _wait was always set to 1,
because one of the conditions was "|| _opcodes[OP_IF_STATEMENT]"
instead of "|| v == _opcodes[OP_IF_STATEMENT]".

Secondly, judging by the older version, this part of the code
should only be allowed to set _wait to 1, never to 0, because we
may have already set it to 1 for other reasons.
  • Loading branch information
Torbjörn Andersson committed May 31, 2015
1 parent dd2c154 commit 07f13be
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions engines/sherlock/talk.cpp
Expand Up @@ -1270,9 +1270,12 @@ void Talk::doScript(const Common::String &script) {
}

byte v = (str >= _scriptEnd ? 0 : str[0]);
_wait = v == _opcodes[OP_SWITCH_SPEAKER] || v == _opcodes[OP_ASSIGN_PORTRAIT_LOCATION] ||
v == _opcodes[OP_BANISH_WINDOW] || _opcodes[OP_IF_STATEMENT] || v == _opcodes[OP_ELSE_STATEMENT] ||
v == _opcodes[OP_END_IF_STATEMENT] || v == _opcodes[OP_GOTO_SCENE] || v == _opcodes[OP_CALL_TALK_FILE];
if (v == _opcodes[OP_SWITCH_SPEAKER] || v == _opcodes[OP_ASSIGN_PORTRAIT_LOCATION] ||
v == _opcodes[OP_BANISH_WINDOW] || v == _opcodes[OP_IF_STATEMENT] ||
v == _opcodes[OP_ELSE_STATEMENT] || v == _opcodes[OP_END_IF_STATEMENT] ||
v == _opcodes[OP_GOTO_SCENE] || v == _opcodes[OP_CALL_TALK_FILE]) {
_wait = 1;
}
}

// Open window if it wasn't already open, and text has already been printed
Expand Down

0 comments on commit 07f13be

Please sign in to comment.