aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/access/player.cpp2
-rw-r--r--engines/access/room.cpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/engines/access/player.cpp b/engines/access/player.cpp
index 420404bf48..063aa76c56 100644
--- a/engines/access/player.cpp
+++ b/engines/access/player.cpp
@@ -624,7 +624,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/room.cpp b/engines/access/room.cpp
index e40c6b7096..e7008c5ab7 100644
--- a/engines/access/room.cpp
+++ b/engines/access/room.cpp
@@ -593,7 +593,7 @@ int Room::calcLR(int yp) {
int rem = (yv % yd) << 1;
yv /= yd;
- if (rem >= yd)
+ if (rem >= yd || rem < 0)
++yv;
return yv + screen._orgX1;
@@ -607,7 +607,7 @@ int Room::calcUD(int xp) {
int rem = (xv % xd) << 1;
xv /= xd;
- if (rem >= xd)
+ if (rem >= xd || rem < 0)
++xv;
return xv + screen._orgY1;
@@ -638,7 +638,8 @@ bool Room::codeWalls() {
if ((player._rawYTemp >= screen._orgY1) &&
(player._rawYTemp <= screen._orgY2)) {
jf._wallCode |= (calcLR(player._rawYTemp) - player._rawXTemp) < 0 ? 2 : 1;
- jf._wallCode1 |= (calcLR(player._rawYTemp) - player._playerOffset.x) < 0 ? 2 : 1;
+ jf._wallCode1 |= (calcLR(player._rawYTemp) -
+ (player._rawXTemp + player._playerOffset.x)) < 0 ? 2 : 1;
}
}