From cd77110093c32f07b84325684ada9a425bdf6c93 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 8 Apr 2014 20:34:39 -0400 Subject: MADS: Fixes for movement issues in the grasslands --- engines/mads/player.cpp | 8 +++++--- 1 file 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; } -- cgit v1.2.3