Skip to content

Commit

Permalink
ACCESS: Fix guard movement logic on slaver boat
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Dec 13, 2014
1 parent cc8a8bf commit 7a691f3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions engines/access/amazon/amazon_scripts.cpp
Expand Up @@ -1085,32 +1085,35 @@ void AmazonScripts::guard() {

switch (_game->_guardLocation) {
case 1:
// Guard walking down
if (curCel <= 8 || curCel > 13)
_game->_guard._guardCel = curCel = 8;

_game->_guard._position.y = _vm->_player->_walkOffDown[curCel - 8];
_game->_guard._position.y += _vm->_player->_walkOffDown[curCel - 8];
guardSee();
if (_game->_guard._position.y >= 272) {
_game->_guard._position.y = 272;
_game->_guardLocation = 2;
}
break;
case 2:
// Guard walking left
if (curCel <= 43 || curCel > 48)
_game->_guard._guardCel = curCel = 43;

_game->_guard._position.x = _vm->_player->_walkOffLeft[curCel - 43];
_game->_guard._position.x -= _vm->_player->_walkOffLeft[curCel - 43];
guardSee();
if (_game->_guard._position.x <= 56) {
_game->_guard._position.x = 56;
_game->_guardLocation = 3;
}
break;
case 3:
// Guard walking up
if (curCel <= 0 || curCel > 5)
_game->_guard._guardCel = curCel = 0;

_game->_guard._position.y = _vm->_player->_walkOffUp[curCel];
_game->_guard._position.y -= _vm->_player->_walkOffUp[curCel];
guardSee();
if (_game->_guard._position.y <= 89) {
_game->_guard._position.y = 89;
Expand All @@ -1120,10 +1123,11 @@ void AmazonScripts::guard() {
}
break;
default:
// Guard walking right
if (curCel <= 43 || curCel > 48)
_game->_guard._guardCel = curCel = 43;

_game->_guard._position.x = _vm->_player->_walkOffRight[curCel - 43];
_game->_guard._position.x += _vm->_player->_walkOffRight[curCel - 43];
guardSee();
if (_game->_guard._position.x >= 127) {
_game->_guard._position.x = 127;
Expand Down

0 comments on commit 7a691f3

Please sign in to comment.