diff options
-rw-r--r-- | engines/sherlock/user_interface.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/engines/sherlock/user_interface.cpp b/engines/sherlock/user_interface.cpp index 9df3f1dc24..bb0667d66a 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; } |