[Scummvm-cvs-logs] SF.net SVN: scummvm:[45823] scummvm/trunk/engines/draci/game.cpp

spalek at users.sourceforge.net spalek at users.sourceforge.net
Wed Nov 11 00:23:40 CET 2009


Revision: 45823
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45823&view=rev
Author:   spalek
Date:     2009-11-10 23:23:40 +0000 (Tue, 10 Nov 2009)

Log Message:
-----------
Fixed walking to unreachable positions

Modified Paths:
--------------
    scummvm/trunk/engines/draci/game.cpp

Modified: scummvm/trunk/engines/draci/game.cpp
===================================================================
--- scummvm/trunk/engines/draci/game.cpp	2009-11-10 23:21:29 UTC (rev 45822)
+++ scummvm/trunk/engines/draci/game.cpp	2009-11-10 23:23:40 UTC (rev 45823)
@@ -988,8 +988,10 @@
 
 	// 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) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list