summaryrefslogtreecommitdiff
path: root/ai/trolly/shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'ai/trolly/shared.c')
-rw-r--r--ai/trolly/shared.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ai/trolly/shared.c b/ai/trolly/shared.c
index 4b33a13a5..c745f31f6 100644
--- a/ai/trolly/shared.c
+++ b/ai/trolly/shared.c
@@ -79,12 +79,12 @@ int AiNew_GetRoadDirection(TileIndex tile_a, TileIndex tile_b, TileIndex tile_c)
}
// Get's the direction between 2 tiles seen from tile_a
-int AiNew_GetDirection(TileIndex tile_a, TileIndex tile_b)
+DiagDirection AiNew_GetDirection(TileIndex tile_a, TileIndex tile_b)
{
- if (TileY(tile_a) < TileY(tile_b)) return 1;
- if (TileY(tile_a) > TileY(tile_b)) return 3;
- if (TileX(tile_a) < TileX(tile_b)) return 2;
- return 0;
+ if (TileY(tile_a) < TileY(tile_b)) return DIAGDIR_SE;
+ if (TileY(tile_a) > TileY(tile_b)) return DIAGDIR_NW;
+ if (TileX(tile_a) < TileX(tile_b)) return DIAGDIR_SW;
+ return DIAGDIR_NE;
}
// This functions looks up if this vehicle is special for this AI