SHERLOCK: Fix trying to move items that can't be

This commit is contained in:
Paul Gilbert 2015-04-30 15:46:30 -10:00
parent e25fbfa8e4
commit 8e4ccdbd2c

View file

@ -2585,6 +2585,17 @@ void UserInterface::checkAction(ActionType &action, const char *const messages[]
if (objNum >= 1000)
// Ignore actions done on characters
return;
if (!action._cAnimSpeed) {
// Invalid action, to print error message
_infoFlag = true;
clearInfo();
screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, messages[action._cAnimNum]);
_infoFlag = true;
// Set how long to show the message
_menuCounter = 30;
} else {
Object &obj = scene._bgShapes[objNum];
if (action._cAnimNum == 0)
@ -2610,7 +2621,6 @@ void UserInterface::checkAction(ActionType &action, const char *const messages[]
dir = -1;
}
if (action._cAnimSpeed) {
// Has a value, so do action
// Show wait cursor whilst walking to object and doing action
events.setCursor(WAIT);
@ -2686,15 +2696,6 @@ void UserInterface::checkAction(ActionType &action, const char *const messages[]
_menuCounter = 30;
}
}
} else {
// Invalid action, to print error message
_infoFlag = true;
clearInfo();
screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, messages[action._cAnimNum]);
_infoFlag = true;
// Set how long to show the message
_menuCounter = 30;
}
// Reset cursor back to arrow