PARALLACTION: Fix Big Red Adventure Walking To Stop On Path Build Failure.

Walking now works correctly, with no valgrind issues, lockups or assertions.

svn-id: r55281
This commit is contained in:
David Turner 2011-01-18 00:22:47 +00:00
parent c6750a7a65
commit f042e398ea

View File

@ -367,7 +367,6 @@ PathWalker_NS::PathWalker_NS() : _direction(WALK_DOWN), _step(0) {
}
bool PathWalker_BR::directPathExists(const Common::Point &from, const Common::Point &to) {
Common::Point copy(from);
Common::Point p(copy);
@ -450,7 +449,7 @@ void PathWalker_BR::buildPath(State &s, uint16 x, uint16 y) {
if (z1->u._pathLists[id].empty()) {
s._walkPath.clear();
debugC(3, kDebugWalk, "buildPath: no path found");
// If no path, trigger finalise and stop of walking...
// If no path, trigger finalize and stop of walking...
s._stillWalkingTowardsNode = false;
return;
}
@ -578,7 +577,8 @@ void PathWalker_BR::doWalk(State &s) {
}
if (!s._stillWalkingTowardsNode) {
s._walkPath.erase(s._walkPath.begin());
if (!s._walkPath.empty())
s._walkPath.erase(s._walkPath.begin());
if (s._walkPath.empty()) {
finalizeWalk(s);