diff options
author | tron <tron@openttd.org> | 2005-01-31 07:23:15 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-31 07:23:15 +0000 |
commit | 7bbcf5875c2fc6a8fa80e417d65e1094947d78b8 (patch) | |
tree | c97da17a330889a788b8654dddbc7507d01b3b38 /ship_cmd.c | |
parent | e1c19367f0cebbe90596319e9f82d959fa54621c (diff) | |
download | openttd-7bbcf5875c2fc6a8fa80e417d65e1094947d78b8.tar.xz |
(svn r1749) Move the functions which calculate distances to map.[ch] and give the more meaningful names
Diffstat (limited to 'ship_cmd.c')
-rw-r--r-- | ship_cmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ship_cmd.c b/ship_cmd.c index dec18586f..238a0b43e 100644 --- a/ship_cmd.c +++ b/ship_cmd.c @@ -73,7 +73,7 @@ static int FindClosestShipDepot(Vehicle *v) for(i=0; i!=lengthof(_depots); i++) { tile = _depots[i].xy; if (IsTileType(tile, MP_WATER) && _map_owner[tile] == owner) { - dist = GetTileDist(tile, tile2); + dist = DistanceManhattan(tile, tile2); if (dist < best_dist) { best_dist = dist; best_depot = i; @@ -106,7 +106,7 @@ static void CheckIfShipNeedsService(Vehicle *v) i = FindClosestShipDepot(v); - if (i < 0 || GetTileDist(v->tile, (&_depots[i])->xy) > 12) { + if (i < 0 || DistanceManhattan(v->tile, (&_depots[i])->xy) > 12) { if (v->current_order.type == OT_GOTO_DEPOT) { v->current_order.type = OT_DUMMY; v->current_order.flags = 0; @@ -499,7 +499,7 @@ static bool ShipTrackFollower(uint tile, PathFindShip *pfs, int track, uint leng // Skip this tile in the calculation if (tile != pfs->skiptile) { - pfs->best_bird_dist = minu(pfs->best_bird_dist, GetTileDist1Db(pfs->dest_coords, tile)); + pfs->best_bird_dist = minu(pfs->best_bird_dist, DistanceMaxPlusManhattan(pfs->dest_coords, tile)); } return false; |