aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorPaul Gilbert2015-10-04 17:36:07 -0400
committerPaul Gilbert2015-10-04 17:36:07 -0400
commitf6b647c420e1525f3127820fb404b2bc1df9c66e (patch)
treee94367830a5727b7917996fd5207d526e60c1660 /engines/sherlock
parent3c990ac16b1720dfa16336ba8d49a6e54aa72a61 (diff)
downloadscummvm-rg350-f6b647c420e1525f3127820fb404b2bc1df9c66e.tar.gz
scummvm-rg350-f6b647c420e1525f3127820fb404b2bc1df9c66e.tar.bz2
scummvm-rg350-f6b647c420e1525f3127820fb404b2bc1df9c66e.zip
SHERLOCK: SS: Fix conversation crash in Spanish version
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/talk.cpp27
-rw-r--r--engines/sherlock/talk.h7
2 files changed, 24 insertions, 10 deletions
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index 416f04f631..e399c268ed 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -750,15 +750,17 @@ void Talk::doScript(const Common::String &script) {
// Start of comment, so skip over it
while (*str++ != '}')
;
- } else if (isOpcode(c)) {
- // Handle control code
- switch ((this->*_opcodeTable[c - _opcodes[0]])(str)) {
- case RET_EXIT:
- return;
- case RET_CONTINUE:
- continue;
- default:
- break;
+ } else if (isPossibleOpcode(c)) {
+ if (isOpcode(c)) {
+ // Handle control code
+ switch ((this->*_opcodeTable[c - _opcodes[0]])(str)) {
+ case RET_EXIT:
+ return;
+ case RET_CONTINUE:
+ continue;
+ default:
+ break;
+ }
}
++str;
@@ -912,6 +914,13 @@ bool Talk::isOpcode(byte checkCharacter) {
return false;
}
+bool Talk::isPossibleOpcode(byte checkCharacter) {
+ if (IS_SERRATED_SCALPEL && _vm->getLanguage() == Common::ES_ESP)
+ return checkCharacter >= 128;
+
+ return isOpcode(checkCharacter);
+}
+
void Talk::popStack() {
if (!_scriptStack.empty()) {
ScriptStackEntry scriptEntry = _scriptStack.pop();
diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h
index f354c28c1b..a0845efb2c 100644
--- a/engines/sherlock/talk.h
+++ b/engines/sherlock/talk.h
@@ -215,11 +215,16 @@ protected:
OpcodeReturn cmdWalkToCAnimation(const byte *&str);
protected:
/**
- * Checks, if a character is an opcode
+ * Checks if a character is an opcode
*/
bool isOpcode(byte checkCharacter);
/**
+ * Checks if a character might be an opcode
+ */
+ bool isPossibleOpcode(byte checkCharacter);
+
+ /**
* Form a table of the display indexes for statements
*/
void setTalkMap();