aboutsummaryrefslogtreecommitdiff
path: root/engines/draci
diff options
context:
space:
mode:
authorRobert Špalek2009-11-10 23:23:40 +0000
committerRobert Špalek2009-11-10 23:23:40 +0000
commitdea7e181727e851e32e9e513f1005d1cb4986e92 (patch)
tree9d1aeb12d5a9e9d41501c506f450c4d92d606092 /engines/draci
parent9ba6e8138c9eb1c4fc603a7dfebd70d781cc3872 (diff)
downloadscummvm-rg350-dea7e181727e851e32e9e513f1005d1cb4986e92.tar.gz
scummvm-rg350-dea7e181727e851e32e9e513f1005d1cb4986e92.tar.bz2
scummvm-rg350-dea7e181727e851e32e9e513f1005d1cb4986e92.zip
Fixed walking to unreachable positions
svn-id: r45823
Diffstat (limited to 'engines/draci')
-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) {