summaryrefslogtreecommitdiff
path: root/src/pathfinder/opf
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-03 20:25:11 +0000
committerrubidium <rubidium@openttd.org>2011-01-03 20:25:11 +0000
commitb68d37f2aa6479d9988aca2fe53af09701b7cd58 (patch)
treed5712ea07736a045957c283fa3298a8fdf27a064 /src/pathfinder/opf
parent7daf2a4ec05124a6fc3c7fc3c9b05923a5f807fa (diff)
downloadopenttd-b68d37f2aa6479d9988aca2fe53af09701b7cd58.tar.xz
(svn r21706) -Fix-ish [FS#4370]: the old ship pathfinder is too stupid to provide "lost" notices; it would even get lost while following it's own path
Diffstat (limited to 'src/pathfinder/opf')
-rw-r--r--src/pathfinder/opf/opf_ship.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/pathfinder/opf/opf_ship.cpp b/src/pathfinder/opf/opf_ship.cpp
index 985c2ed5d..9cf574484 100644
--- a/src/pathfinder/opf/opf_ship.cpp
+++ b/src/pathfinder/opf/opf_ship.cpp
@@ -204,12 +204,8 @@ Track OPFShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir,
/* And if we would not reverse? */
uint dist = FindShipTrack(v, tile, enterdir, tracks, 0, &track);
- /* If the dist equals zero, or distr equals one (the extra reversing penalty),
- * then we found our destination and we are not lost.
- * When we are not lost (yet) and the distance to our destination becomes
- * less, then we aren't lost yet.
- * So, we only become lost when the distance to our destination increases. */
- path_found = (dist == 0 || distr == 1 || (!(v->vehicle_flags & VF_PATHFINDER_LOST) && min(dist, distr) < DistanceManhattan(tile, v->dest_tile)));
+ /* Due to the way this pathfinder works we cannot determine whether we're lost or not. */
+ path_found = true;
if (dist <= distr) return track;
return INVALID_TRACK; // We could better reverse
}