aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/actor_walk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/bladerunner/actor_walk.cpp')
-rw-r--r--engines/bladerunner/actor_walk.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/engines/bladerunner/actor_walk.cpp b/engines/bladerunner/actor_walk.cpp
index daa28b6350..1c91ce0155 100644
--- a/engines/bladerunner/actor_walk.cpp
+++ b/engines/bladerunner/actor_walk.cpp
@@ -73,12 +73,14 @@ bool ActorWalk::setup(int actorId, bool runFlag, const Vector3 &from, const Vect
} else {
stop(actorId, true, kAnimationModeCombatIdle, kAnimationModeIdle);
}
+// debug("actor id: %d, arrived: %d - false setup 01", actorId, (*arrived)? 1:0);
return false;
}
if (r == -1) {
stop(actorId, true, kAnimationModeCombatIdle, kAnimationModeIdle);
*arrived = true;
+// debug("actor id: %d, arrived: %d - false setup 02", actorId, (*arrived)? 1:0);
return false;
}
@@ -107,6 +109,7 @@ bool ActorWalk::setup(int actorId, bool runFlag, const Vector3 &from, const Vect
if (next.x == _current.x && next.z == _current.z) {
stop(actorId, true, kAnimationModeCombatIdle, kAnimationModeIdle);
*arrived = true;
+// debug("actor id: %d, arrived: %d - false setup 03", actorId, (*arrived)? 1:0);
return false;
}
@@ -115,6 +118,7 @@ bool ActorWalk::setup(int actorId, bool runFlag, const Vector3 &from, const Vect
_running = runFlag;
_status = 2;
+// debug("actor id: %d, arrived: %d - true setup 01", actorId, (*arrived)? 1:0);
return true;
}
@@ -201,6 +205,9 @@ bool ActorWalk::tick(int actorId, float stepDistance, bool mustReachWalkDestinat
if (nextIsCloseEnough) {
return false;
}
+ } else {
+ stop(actorId, true, kAnimationModeCombatIdle, kAnimationModeIdle); // too close
+ return true;
}
}
@@ -419,6 +426,7 @@ int ActorWalk::nextOnPath(int actorId, const Vector3 &from, const Vector3 &to, V
next = from;
if (distance(from, to) < 6.0) {
+// debug("Id: %d Distance: %f::Result -1", actorId, distance(from, to));
return -1;
}
@@ -427,9 +435,11 @@ int ActorWalk::nextOnPath(int actorId, const Vector3 &from, const Vector3 &to, V
return 1;
}
if (_vm->_scene->_set->findWalkbox(to.x, to.z) == -1) {
+// debug("Id: %d No walkbox::Result 0", actorId);
return 0;
}
if (_vm->_sceneObjects->existsOnXZ(actorId + kSceneObjectOffsetActors, to.x, to.z, false, false)) {
+// debug("Actor Id: %d existsOnXZ::Result 0", actorId);
return 0;
}
Vector3 next1;
@@ -437,6 +447,7 @@ int ActorWalk::nextOnPath(int actorId, const Vector3 &from, const Vector3 &to, V
next = next1;
return 1;
}
+// debug("Id: %d DEFAULTED::Result 0", actorId);
return 0;
}