summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2019-02-25 13:07:22 +0000
committerPeterN <peter@fuzzle.org>2019-03-31 17:22:54 +0100
commit66bed86bbb76ff799e79df1796535f592af81a1f (patch)
treece533ab9ec231a7dc2548d02c8c9a6adcbdc8166 /src
parentd0e8060182503627e17b74b4fa4c2b2637020f1a (diff)
downloadopenttd-66bed86bbb76ff799e79df1796535f592af81a1f.tar.xz
Fix #7062, Revert 7af53d7588: Don't test ship max order distance when pathfinding.
Diffstat (limited to 'src')
-rw-r--r--src/ship_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index c04d3e1e2..6c2d09a16 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -466,8 +466,8 @@ static Track ChooseShipTrack(Ship *v, TileIndex tile, DiagDirection enterdir, Tr
bool path_found = true;
Track track;
- if (v->dest_tile == 0 || DistanceManhattan(tile, v->dest_tile) > SHIP_MAX_ORDER_DISTANCE + 5) {
- /* No destination or destination too far, don't invoke pathfinder. */
+ if (v->dest_tile == 0) {
+ /* No destination, don't invoke pathfinder. */
track = TrackBitsToTrack(v->state);
if (!IsDiagonalTrack(track)) track = TrackToOppositeTrack(track);
if (!HasBit(tracks, track)) track = FindFirstTrack(tracks);