From 7bbcf5875c2fc6a8fa80e417d65e1094947d78b8 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 31 Jan 2005 07:23:15 +0000 Subject: (svn r1749) Move the functions which calculate distances to map.[ch] and give the more meaningful names --- ai_pathfinder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ai_pathfinder.c') diff --git a/ai_pathfinder.c b/ai_pathfinder.c index 4510c60f4..6266352dd 100644 --- a/ai_pathfinder.c +++ b/ai_pathfinder.c @@ -153,12 +153,12 @@ static int32 AyStar_AiPathFinder_CalculateH(AyStar *aystar, AyStarNode *current, int r, r2; if (PathFinderInfo->end_direction != AI_PATHFINDER_NO_DIRECTION) { // The station is pointing to a direction, add a tile towards that direction, so the H-value is more accurate - r = GetTileDist(current->tile, PathFinderInfo->end_tile_tl + TileOffsByDir(PathFinderInfo->end_direction)); - r2 = GetTileDist(current->tile, PathFinderInfo->end_tile_br + TileOffsByDir(PathFinderInfo->end_direction)); + r = DistanceManhattan(current->tile, PathFinderInfo->end_tile_tl + TileOffsByDir(PathFinderInfo->end_direction)); + r2 = DistanceManhattan(current->tile, PathFinderInfo->end_tile_br + TileOffsByDir(PathFinderInfo->end_direction)); } else { // No direction, so just get the fastest route to the station - r = GetTileDist(current->tile, PathFinderInfo->end_tile_tl); - r2 = GetTileDist(current->tile, PathFinderInfo->end_tile_br); + r = DistanceManhattan(current->tile, PathFinderInfo->end_tile_tl); + r2 = DistanceManhattan(current->tile, PathFinderInfo->end_tile_br); } // See if the bottomright is faster than the topleft.. if (r2 < r) r = r2; -- cgit v1.2.3-54-g00ecf