diff options
| author | Paul Gilbert | 2015-04-30 15:46:30 -1000 | 
|---|---|---|
| committer | Paul Gilbert | 2015-04-30 15:46:30 -1000 | 
| commit | 8e4ccdbd2c5ea543d648ef46300837c3c43ee705 (patch) | |
| tree | 857cbaf06afdfb7c7d2f66ad02a69225710982d1 | |
| parent | e25fbfa8e4a2e6ca2ef187630479151107f8ff19 (diff) | |
| download | scummvm-rg350-8e4ccdbd2c5ea543d648ef46300837c3c43ee705.tar.gz scummvm-rg350-8e4ccdbd2c5ea543d648ef46300837c3c43ee705.tar.bz2 scummvm-rg350-8e4ccdbd2c5ea543d648ef46300837c3c43ee705.zip  | |
SHERLOCK: Fix trying to move items that can't be
| -rw-r--r-- | engines/sherlock/user_interface.cpp | 59 | 
1 files changed, 30 insertions, 29 deletions
diff --git a/engines/sherlock/user_interface.cpp b/engines/sherlock/user_interface.cpp index b0b0d15b5c..30d79aa1c9 100644 --- a/engines/sherlock/user_interface.cpp +++ b/engines/sherlock/user_interface.cpp @@ -2585,32 +2585,42 @@ void UserInterface::checkAction(ActionType &action, const char *const messages[]  	if (objNum >= 1000)  		// Ignore actions done on characters  		return; -	Object &obj = scene._bgShapes[objNum]; -	if (action._cAnimNum == 0) -		// Really a 10 -		cAnimNum = 9; -	else -		cAnimNum = action._cAnimNum - 1; -	 -	if (action._cAnimNum != 99) { -		CAnim &anim = scene._cAnim[cAnimNum]; +	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) +			// Really a 10 +			cAnimNum = 9; +		else +			cAnimNum = action._cAnimNum - 1; +	  		if (action._cAnimNum != 99) { -			if (action._cAnimSpeed & REVERSE_DIRECTION) { -				pt = anim._teleportPos; -				dir = anim._teleportDir; -			} else { -				pt = anim._goto; -				dir = anim._gotoDir; +			CAnim &anim = scene._cAnim[cAnimNum]; + +			if (action._cAnimNum != 99) { +				if (action._cAnimSpeed & REVERSE_DIRECTION) { +					pt = anim._teleportPos; +					dir = anim._teleportDir; +				} else { +					pt = anim._goto; +					dir = anim._gotoDir; +				}  			} +		} else { +			pt = Common::Point(-1, -1); +			dir = -1;  		} -	} else { -		pt = Common::Point(-1, -1); -		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  | 
