aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-06-11 21:45:47 +0000
committerMax Horn2003-06-11 21:45:47 +0000
commit0503b553dfddc736a14a1b7d894308929e8b0ef5 (patch)
tree7affdec6feae4d286d9030efb3ba0201ead66ab1 /scumm
parent17a5a69c0447f8b8f4cd47c99e5cf76ab288f75b (diff)
downloadscummvm-rg350-0503b553dfddc736a14a1b7d894308929e8b0ef5.tar.gz
scummvm-rg350-0503b553dfddc736a14a1b7d894308929e8b0ef5.tar.bz2
scummvm-rg350-0503b553dfddc736a14a1b7d894308929e8b0ef5.zip
some walk fixes
svn-id: r8439
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script_v5.cpp14
-rw-r--r--scumm/script_v6.cpp9
2 files changed, 15 insertions, 8 deletions
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index b5676ce9d6..0159eb386d 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -2372,7 +2372,7 @@ void Scumm_v5::o5_walkActorTo() {
}
void Scumm_v5::o5_walkActorToActor() {
- int x;
+ int x, y;
Actor *a, *a2;
int nr = getVarOrDirectByte(0x80);
int nr2 = getVarOrDirectByte(0x40);
@@ -2403,16 +2403,22 @@ void Scumm_v5::o5_walkActorToActor() {
if (_version <= 2)
dist *= 8;
else if (dist == 0xFF) {
- dist = a2->scalex * a->width / 0xFF;
+ dist = a2->scalex * a2->width / 0xFF;
dist += dist / 2;
}
x = a2->x;
+ y = a2->y;
if (x < a->x)
x += dist;
else
x -= dist;
-
- a->startWalkActor(x, a2->y, -1);
+
+ if (_version <= 3) {
+ AdjustBoxResult abr = a->adjustXYToBeInBox(x, y);
+ x = abr.x;
+ y = abr.y;
+ }
+ a->startWalkActor(x, y, -1);
}
void Scumm_v5::o5_walkActorToObject() {
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index a664e5ac87..2143404832 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -989,7 +989,7 @@ void Scumm_v6::o6_stopScript() {
void Scumm_v6::o6_walkActorToObj() {
int act, obj, dist;
Actor *a, *a2;
- int x;
+ int x, y;
dist = pop();
obj = pop();
@@ -999,7 +999,7 @@ void Scumm_v6::o6_walkActorToObj() {
if (obj >= _numActors) {
if (whereIsObject(obj) == WIO_NOT_FOUND)
return;
- int y, dir;
+ int dir;
getObjectXYPos(obj, x, y, dir);
a->startWalkActor(x, y, dir);
} else {
@@ -1015,14 +1015,15 @@ void Scumm_v6::o6_walkActorToObj() {
return;
if (dist == 0) {
dist = a2->scalex * a2->width / 0xFF;
- dist += dist >> 1;
+ dist += dist / 2;
}
x = a2->x;
+ y = a2->y;
if (x < a->x)
x += dist;
else
x -= dist;
- a->startWalkActor(x, a2->y, -1);
+ a->startWalkActor(x, y, -1);
}
}