diff options
author | David Turner | 2011-01-18 00:22:47 +0000 |
---|---|---|
committer | David Turner | 2011-01-18 00:22:47 +0000 |
commit | f042e398eaea1bc15f76fd1739f98b3245c33cd0 (patch) | |
tree | ce2c5ffe3fa6324176ae9f0623abcf02d6507a3e /engines/parallaction/walk.cpp | |
parent | c6750a7a650f668627ab5e86352f66aef6257f7e (diff) | |
download | scummvm-rg350-f042e398eaea1bc15f76fd1739f98b3245c33cd0.tar.gz scummvm-rg350-f042e398eaea1bc15f76fd1739f98b3245c33cd0.tar.bz2 scummvm-rg350-f042e398eaea1bc15f76fd1739f98b3245c33cd0.zip |
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
Diffstat (limited to 'engines/parallaction/walk.cpp')
-rw-r--r-- | engines/parallaction/walk.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index 40df28504f..be69614be4 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -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); |