[Scummvm-cvs-logs] scummvm master -> f6b647c420e1525f3127820fb404b2bc1df9c66e

dreammaster dreammaster at scummvm.org
Sun Oct 4 23:36:32 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f6b647c420 SHERLOCK: SS: Fix conversation crash in Spanish version


Commit: f6b647c420e1525f3127820fb404b2bc1df9c66e
    https://github.com/scummvm/scummvm/commit/f6b647c420e1525f3127820fb404b2bc1df9c66e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-10-04T17:36:07-04:00

Commit Message:
SHERLOCK: SS: Fix conversation crash in Spanish version

Changed paths:
    engines/sherlock/talk.cpp
    engines/sherlock/talk.h



diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index 416f04f..e399c26 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 f354c28..a0845ef 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();






More information about the Scummvm-git-logs mailing list