aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-04-08 20:34:39 -0400
committerPaul Gilbert2014-04-08 20:34:39 -0400
commitcd77110093c32f07b84325684ada9a425bdf6c93 (patch)
treef586b5662b99a262c0c232883ee071f2a7f5d33a /engines
parent3e2cba4cdac011372882336a5572219aa08380f2 (diff)
downloadscummvm-rg350-cd77110093c32f07b84325684ada9a425bdf6c93.tar.gz
scummvm-rg350-cd77110093c32f07b84325684ada9a425bdf6c93.tar.bz2
scummvm-rg350-cd77110093c32f07b84325684ada9a425bdf6c93.zip
MADS: Fixes for movement issues in the grasslands
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/player.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp
index 10d8b3e327..bf5e59ecde 100644
--- a/engines/mads/player.cpp
+++ b/engines/mads/player.cpp
@@ -426,27 +426,29 @@ void Player::move() {
if (_scalingVelocity && (_totalDistance > 0)) {
int angleRange = 100 - _currentScale;
int angleScale = angleRange * (_posDiff.x - 1) / _totalDistance + _currentScale;
- velocity = MAX(1, 10000 / (angleScale * _currentScale * velocity));
+ velocity = MAX(1L, (angleScale * _currentScale * velocity) / 10000L);
}
if (!_moving || (_facing != _turnToFacing))
return;
Common::Point newPos = _playerPos;
+ newFacing = false;
+ _special = 0;
if (_distAccum < velocity) {
do {
if (_pixelAccum < _posDiff.x)
_pixelAccum += _posDiff.y;
if (_pixelAccum >= _posDiff.x) {
- if ((_posChange.y > 0) || (_walkOffScreen != 0))
+ if ((_posChange.y > 0) || _walkOffScreen)
newPos.y += _yDirection;
--_posChange.y;
_pixelAccum -= _posDiff.x;
}
if (_pixelAccum < _posDiff.x) {
- if ((_posChange.x > 0) || (_walkOffScreen != 0))
+ if ((_posChange.x > 0) || _walkOffScreen)
newPos.x += _xDirection;
--_posChange.x;
}