roadveh_cmd.c
changeset 1698 bf364c664a60
parent 1680 0ca4f679c154
child 1709 80b108681ff1
--- a/roadveh_cmd.c	Thu Apr 14 22:59:49 2005 +0000
+++ b/roadveh_cmd.c	Fri Apr 15 13:48:08 2005 +0000
@@ -1090,12 +1090,16 @@
 		//debug("Finding path. Enterdir: %d, Trackdir: %d", enterdir, trackdir);
 
 		ftd = NPFRouteToStationOrTile(tile - TileOffsByDir(enterdir), trackdir, &fstd, TRANSPORT_ROAD, v->owner);
-		if (ftd.best_bird_dist != 0 || ftd.best_trackdir == 0xff) {
-			/* Not found, just do something, or we are already there */
+		if (ftd.best_trackdir == 0xff) {
+			/* We are already at our target. Just do something */
 			//TODO: maybe display error?
 			//TODO: go straight ahead if possible?
 			return_track(FindFirstBit2x64(bitmask));
 		} else {
+			/* If ftd.best_bird_dist is 0, we found our target and ftd.best_trackdir contains
+			the direction we need to take to get there, if ftd.best_bird_dist is not 0,
+			we did not find our target, but ftd.best_trackdir contains the direction leading
+			to the tile closest to our target. */
 			return_track(ftd.best_trackdir);
 		}
 	} else {