Skip to content

Commit

Permalink
Fix OpenTTD#7062, Revert 7af53d7: Don't test ship max order distance …
Browse files Browse the repository at this point in the history
…when pathfinding.
  • Loading branch information
PeterN committed Feb 25, 2019
1 parent 6ff02f0 commit 16f94b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ship_cmd.cpp
Expand Up @@ -470,8 +470,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)) {
Expand Down

0 comments on commit 16f94b7

Please sign in to comment.