diff options
author | tron <tron@openttd.org> | 2005-01-07 17:02:43 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-07 17:02:43 +0000 |
commit | 7ca6b2b8b0d6f66966fa2ff01e3e9961314dfcc4 (patch) | |
tree | e4137b60a824b45ce09f668d58520e36dba10256 /ai.c | |
parent | f5c33e50733c46cee14e84ade6da0c171d96064b (diff) | |
download | openttd-7ca6b2b8b0d6f66966fa2ff01e3e9961314dfcc4.tar.xz |
(svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY]
Diffstat (limited to 'ai.c')
-rw-r--r-- | ai.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -622,17 +622,17 @@ static bool AiCheckIfRouteIsGood(Player *p, FoundRoute *fr, byte bitmask) static byte AiGetDirectionBetweenTiles(TileIndex a, TileIndex b) { - byte i = (GET_TILE_X(a) < GET_TILE_X(b)) ? 1 : 0; - if (GET_TILE_Y(a) >= GET_TILE_Y(b)) i ^= 3; + byte i = (TileX(a) < TileX(b)) ? 1 : 0; + if (TileY(a) >= TileY(b)) i ^= 3; return i; } static TileIndex AiGetPctTileBetween(TileIndex a, TileIndex b, byte pct) { return TILE_XY( - GET_TILE_X(a) + ((GET_TILE_X(b) - GET_TILE_X(a)) * pct >> 8), - GET_TILE_Y(a) + ((GET_TILE_Y(b) - GET_TILE_Y(a)) * pct >> 8) - ); + TileX(a) + ((TileX(b) - TileX(a)) * pct >> 8), + TileY(a) + ((TileY(b) - TileY(a)) * pct >> 8) + ); } static void AiWantLongIndustryRoute(Player *p) |