aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/draci/game.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 82bddb6f9d..53ada6ace4 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -988,8 +988,10 @@ void Game::walkHero(int x, int y, SightDirection dir) {
// Compute the shortest and obliqued path.
WalkingPath shortestPath, obliquePath;
- _walkingMap.findShortestPath(_hero, target, &shortestPath);
- // TODO: test reachability and react
+ if (!_walkingMap.findShortestPath(_hero, target, &shortestPath)) {
+ debug(1, "Unreachable point [%d,%d]", target.x, target.y);
+ return;
+ }
_walkingMap.obliquePath(shortestPath, &obliquePath);
debugC(2, kDraciWalkingDebugLevel, "Walking path lengths: shortest=%d oblique=%d", shortestPath.size(), obliquePath.size());
if (_vm->_showWalkingMap) {