diff options
-rw-r--r-- | engines/access/player.cpp | 6 | ||||
-rw-r--r-- | engines/access/player.h | 4 | ||||
-rw-r--r-- | engines/access/room.cpp | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/engines/access/player.cpp b/engines/access/player.cpp index 0733e80c7d..44dd0d2182 100644 --- a/engines/access/player.cpp +++ b/engines/access/player.cpp @@ -565,6 +565,8 @@ void Player::walkDownRight() { void Player::checkMove() { if (_playerMove) { if (_xFlag == 0 && _yFlag == 0) { + // Figure out whether a greater horizontal movement than vertical + // movement will be required, or vice versa int xp = (_playerOffset.x / 2) + _rawPlayer.x - _moveTo.x; if (xp < 0) xp = -xp; @@ -572,7 +574,7 @@ void Player::checkMove() { if (yp < 0) yp = -yp; - if (xp < yp) + if (xp > yp) _xFlag = 1; else _yFlag = 1; @@ -600,7 +602,7 @@ void Player::checkMove() { } } } else if (_xFlag == 1) { - int xd = _rawPlayer.x - _moveTo.x; + int xd = _playerOffset.x / 2 + _rawPlayer.x - _moveTo.x; if ((xd >= 0 && xd <= -_leftDelta) || (xd < 0 && -xd <= -_leftDelta)) { ++_xFlag; diff --git a/engines/access/player.h b/engines/access/player.h index 876c0e5ea4..7ba0c05b21 100644 --- a/engines/access/player.h +++ b/engines/access/player.h @@ -86,9 +86,9 @@ public: Common::Point _walkOffDR[PLAYER_DATA_COUNT]; Common::Point _walkOffUL[PLAYER_DATA_COUNT]; Common::Point _walkOffDL[PLAYER_DATA_COUNT]; - int _rawTempL; + byte _rawTempL; int _rawXTemp; - int _rawYTempL; + byte _rawYTempL; int _rawYTemp; Common::Point _playerOffset; int _playerXLow; diff --git a/engines/access/room.cpp b/engines/access/room.cpp index 9c2bd01650..5e3a4d743d 100644 --- a/engines/access/room.cpp +++ b/engines/access/room.cpp @@ -653,7 +653,7 @@ bool Room::codeWalls() { if ((player._rawXTemp >= screen._orgX1) && (player._rawXTemp <= screen._orgX2)) { int y = screen._orgY2; - if (y == screen._orgY1) + if (y != screen._orgY1) y = calcUD(player._rawXTemp); jf._wallCode |= (player._rawYTemp - y) < 0 ? 4 : 8; @@ -691,8 +691,6 @@ bool Room::checkCode(int v1, int v2) { Player &p = *_vm->_player; if (!v1) { - p._collideFlag = true; - return true; } if (!v2 || (v1 == v2)) { } else if (v1 & 1) { if (v2 & 2) { |