[Scummvm-cvs-logs] scummvm master -> 9350c342bb77ba93910bdc68d44a169e8ae320c5

dreammaster dreammaster at scummvm.org
Sat Aug 8 01:45:13 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:
9350c342bb SHERLOCK: RT: Fix using items on NPCs


Commit: 9350c342bb77ba93910bdc68d44a169e8ae320c5
    https://github.com/scummvm/scummvm/commit/9350c342bb77ba93910bdc68d44a169e8ae320c5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-07T19:44:16-04:00

Commit Message:
SHERLOCK: RT: Fix using items on NPCs

Changed paths:
    engines/sherlock/user_interface.cpp



diff --git a/engines/sherlock/user_interface.cpp b/engines/sherlock/user_interface.cpp
index 9df3f1d..bb0667d 100644
--- a/engines/sherlock/user_interface.cpp
+++ b/engines/sherlock/user_interface.cpp
@@ -69,11 +69,11 @@ void UserInterface::checkAction(ActionType &action, int objNum, FixedTextActionI
 		// Automatically set the given flag
 		_vm->setFlags(action._useFlag);
 
-	if (objNum >= 1000)
+	if (IS_SERRATED_SCALPEL && objNum >= 1000)
 		// Ignore actions done on characters
 		return;
 
-	if (!action._cAnimSpeed) {
+	if (IS_SERRATED_SCALPEL && !action._cAnimSpeed) {
 		// Invalid action, to print error message
 		_infoFlag = true;
 		clearInfo();
@@ -84,7 +84,11 @@ void UserInterface::checkAction(ActionType &action, int objNum, FixedTextActionI
 		// Set how long to show the message
 		_menuCounter = 30;
 	} else {
-		Object &obj = scene._bgShapes[objNum];
+		BaseObject *obj;
+		if (objNum >= 1000)
+			obj = &people[objNum - 1000];
+		else
+			obj = &scene._bgShapes[objNum];
 
 		int cAnimNum;
 		if (action._cAnimNum == 0)
@@ -119,7 +123,7 @@ void UserInterface::checkAction(ActionType &action, int objNum, FixedTextActionI
 		for (int nameIdx = 0; nameIdx < NAMES_COUNT; ++nameIdx) {
 			if (action._names[nameIdx].hasPrefix("*") && action._names[nameIdx].size() >= 2
 					&& toupper(action._names[nameIdx][1]) == 'W') {
-				if (obj.checkNameForCodes(Common::String(action._names[nameIdx].c_str() + 2), fixedTextActionId)) {
+				if (obj->checkNameForCodes(Common::String(action._names[nameIdx].c_str() + 2), fixedTextActionId)) {
 					if (!talk._talkToAbort)
 						printed = true;
 				}
@@ -160,7 +164,7 @@ void UserInterface::checkAction(ActionType &action, int objNum, FixedTextActionI
 		for (int nameIdx = 0; nameIdx < NAMES_COUNT; ++nameIdx) {
 			if (action._names[nameIdx].hasPrefix("*") && action._names[nameIdx].size() >= 2
 					&& toupper(action._names[nameIdx][1]) == 'F') {
-				if (obj.checkNameForCodes(action._names[nameIdx].c_str() + 2, fixedTextActionId)) {
+				if (obj->checkNameForCodes(action._names[nameIdx].c_str() + 2, fixedTextActionId)) {
 					if (!talk._talkToAbort)
 						printed = true;
 				}
@@ -172,7 +176,7 @@ void UserInterface::checkAction(ActionType &action, int objNum, FixedTextActionI
 
 		if (!talk._talkToAbort) {
 			for (int nameIdx = 0; nameIdx < NAMES_COUNT && !talk._talkToAbort; ++nameIdx) {
-				if (obj.checkNameForCodes(action._names[nameIdx], fixedTextActionId)) {
+				if (obj->checkNameForCodes(action._names[nameIdx], fixedTextActionId)) {
 					if (!talk._talkToAbort)
 						printed = true;
 				}






More information about the Scummvm-git-logs mailing list