summaryrefslogtreecommitdiff
path: root/ai/trolly/shared.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-04-23 19:08:33 +0000
committertron <tron@openttd.org>2006-04-23 19:08:33 +0000
commit8ef2c13c65498dfc39cb80bd1c07589b747fe1e6 (patch)
treecd4c186a9c07742ae1c885398e52e5cc5ad5bab3 /ai/trolly/shared.c
parent72d3fabb58a98921b963cfc7b788e498275724cc (diff)
downloadopenttd-8ef2c13c65498dfc39cb80bd1c07589b747fe1e6.tar.xz
(svn r4553) int and magic numbers -> Slope and DiagDirection
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