From 2826a06bc56386f845fd6551ba422f1baf5e3ecd Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 31 May 2015 16:05:31 +0200 Subject: SHERLOCK: Fix regression in conversations 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. --- engines/sherlock/talk.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'engines/sherlock') diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index 96e4d0d41c..59897e2c2a 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -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 -- cgit v1.2.3