aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
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();