diff options
author | Tobias Gunkel | 2012-01-29 04:42:02 +0100 |
---|---|---|
committer | Tobias Gunkel | 2012-02-11 08:29:46 +0100 |
commit | cc68a598564285b6f303f90304891f0beef7f1e4 (patch) | |
tree | 0ed8feeb08159c83c42abe458a60de1b457b665e | |
parent | 7d409dd15f13f517c083e58d0e5c59ec0776c974 (diff) | |
download | scummvm-rg350-cc68a598564285b6f303f90304891f0beef7f1e4.tar.gz scummvm-rg350-cc68a598564285b6f303f90304891f0beef7f1e4.tar.bz2 scummvm-rg350-cc68a598564285b6f303f90304891f0beef7f1e4.zip |
SCUMM: fix diagonal walking in at least MM v0
The comparison "ABS((int)(deltaXFactor >> 16)) > _speedx)" does not work as "deltaXFactor >> 16" will clear the fractional part of deltaXFactor. As a result the deltaXFactor might be bigger than (_speedx<<16) and the actor moves faster than he should.
-rw-r--r-- | engines/scumm/actor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 0191439612..f0ba79b98d 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -289,7 +289,7 @@ int Actor::calcMovementFactor(const Common::Point& next) { deltaYFactor = 0; } - if ((uint) ABS((int)(deltaXFactor >> 16)) > _speedx) { + if ((uint) ABS(deltaXFactor) > (_speedx << 16)) { deltaXFactor = _speedx << 16; if (diffX < 0) deltaXFactor = -deltaXFactor; |