aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-09-19 01:12:05 +0000
committerMax Horn2003-09-19 01:12:05 +0000
commit1a6d75ef39f0d76b099ed33d95fb4944ccaa2740 (patch)
tree213f60fc767a10ce322cc7611b35f5f05463d2a1
parentf7d50f7c68f4c48edacf8d1c6fd60bd3e17f5a6d (diff)
downloadscummvm-rg350-1a6d75ef39f0d76b099ed33d95fb4944ccaa2740.tar.gz
scummvm-rg350-1a6d75ef39f0d76b099ed33d95fb4944ccaa2740.tar.bz2
scummvm-rg350-1a6d75ef39f0d76b099ed33d95fb4944ccaa2740.zip
changed scumm/object.cpp for V1/V2 once again - this time it really should match the original behaviour
svn-id: r10306
-rw-r--r--scumm/object.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 245b883a34..847441c58e 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -298,11 +298,17 @@ int Scumm::getObjActToObjActDist(int a, int b) {
}
// Now compute the distance between the two points
- dist = getDist(x, y, x2, y2);
- // For V1/V2 games, distances are measured in "charactes" instead of pixels,
- // so we divide by 8, rounding up.
- if (_version <= 2)
- dist = (dist + 7) / 8;
+ x = ABS(x - x2);
+ y = ABS(y - y2);
+
+ // For V1/V2 games, distances are measured in the original "character"
+ // based coordinate system, instead of pixels. Otherwise various scripts
+ // will break.
+ if (_version <= 2) {
+ dist = MAX(x/8, y/2);
+ } else
+ dist = MAX(x, y);
+
return dist;
}