From cc68a598564285b6f303f90304891f0beef7f1e4 Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Sun, 29 Jan 2012 04:42:02 +0100 Subject: 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. --- engines/scumm/actor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/scumm/actor.cpp') 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; -- cgit v1.2.3