ai/trolly/shared.c
changeset 3644 7c9a6a91873b
parent 2381 9a5ed6c0a2e6
child 4077 d4d440dd8925
--- a/ai/trolly/shared.c	Sun Apr 23 18:37:53 2006 +0000
+++ b/ai/trolly/shared.c	Sun Apr 23 19:08:33 2006 +0000
@@ -79,12 +79,12 @@
 }
 
 // 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