aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Mettifogo2007-01-18 21:25:02 +0000
committerNicola Mettifogo2007-01-18 21:25:02 +0000
commit7d8ddb9a5b89b9839cd82230699049f80960a358 (patch)
treee68c5886137d23bee5bd7111fa6b3b9e87d902ef
parent684a71cee065890fb8ee3df5a4fc821e2cec3638 (diff)
downloadscummvm-rg350-7d8ddb9a5b89b9839cd82230699049f80960a358.tar.gz
scummvm-rg350-7d8ddb9a5b89b9839cd82230699049f80960a358.tar.bz2
scummvm-rg350-7d8ddb9a5b89b9839cd82230699049f80960a358.zip
fixed walk bug: characters now walk along complex paths
svn-id: r25117
-rw-r--r--engines/parallaction/walk.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp
index 7813233aea..85b3d60f33 100644
--- a/engines/parallaction/walk.cpp
+++ b/engines/parallaction/walk.cpp
@@ -216,6 +216,15 @@ WalkNode *buildWalkPath(uint16 x, uint16 y) {
debugC(1, kDebugWalk, "walk path completed");
+ WalkNode* tmp = &v58;
+ uint16 i = 1;
+ while (tmp->_node._next) {
+ debugC(1, kDebugWalk, "node %i: %i, %i", i, tmp->_x, tmp->_y);
+ tmp = (WalkNode*)tmp->_node._next;
+ i++;
+ }
+
+
memFree(v44);
return (WalkNode*)v58._node._next;
}
@@ -312,22 +321,30 @@ void jobWalk(void *parm, Job *j) {
int16 _si = _yourself._zone.pos._position._x;
int16 _di = _yourself._zone.pos._position._y;
- debugC(1, kDebugWalk, "jobWalk to (%i, %i)", node->_x + _yourself._cnv._width / 2, node->_y + _yourself._cnv._height);
+// debugC(1, kDebugWalk, "jobWalk to (%i, %i)", node->_x + _yourself._cnv._width / 2, node->_y + _yourself._cnv._height);
_yourself._zone.pos._oldposition._x = _si;
_yourself._zone.pos._oldposition._y = _di;
- if ((node->_x == 0) && (node->_y == 0)) {
+ if ((node->_x == _si) && (node->_y == _di)) {
if (node->_node._next == NULL) {
+
+ debugC(1, kDebugWalk, "jobWalk reached last node");
+
j->_finished = 1;
checkDoor();
memFree(node);
return;
}
+
+ WalkNode *tmp = (WalkNode*)node->_node._next;
j->_parm = node->_node._next;
memFree(node);
- node = (WalkNode*)node->_node._next;
+
+ debugC(1, kDebugWalk, "jobWalk moving to next node (%i, %i)", tmp->_x, tmp->_y);
+
+ node = (WalkNode*)tmp;
}
Point dist = {