diff options
author | frosch <frosch@openttd.org> | 2008-02-20 17:49:50 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-02-20 17:49:50 +0000 |
commit | b7993793c813359ba4963df93d49a80335ddca36 (patch) | |
tree | d325400c42801ac23226ccaf0d71008e4e3598ec /src/ai/default | |
parent | 9e651575481dbdd4b587fe22e2d79b998bcbbe15 (diff) | |
download | openttd-b7993793c813359ba4963df93d49a80335ddca36.tar.xz |
(svn r12199) -Codechange: Remove magic around the results of GetTileTrackStatus().
Diffstat (limited to 'src/ai/default')
-rw-r--r-- | src/ai/default/default.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp index 1c83d4edf..81adf016f 100644 --- a/src/ai/default/default.cpp +++ b/src/ai/default/default.cpp @@ -69,10 +69,9 @@ enum { }; -static TrackBits GetRailTrackStatus(TileIndex tile) +static inline TrackBits GetRailTrackStatus(TileIndex tile) { - uint32 r = GetTileTrackStatus(tile, TRANSPORT_RAIL, 0); - return (TrackBits)(byte) (r | r >> 8); + return TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_RAIL, 0)); } @@ -2883,7 +2882,7 @@ static bool AiCheckRoadFinished(Player *p) tile = TILE_MASK(_players_ai[p->index].cur_tile_a + TileOffsByDiagDir(dir)); if (IsRoadStopTile(tile) || IsTileDepotType(tile, TRANSPORT_ROAD)) return false; - bits = GetTileTrackStatus(tile, TRANSPORT_ROAD, ROADTYPES_ROAD) & _ai_road_table_and[dir]; + bits = TrackStatusToTrackdirBits(GetTileTrackStatus(tile, TRANSPORT_ROAD, ROADTYPES_ROAD)) & _ai_road_table_and[dir]; if (bits == 0) return false; are.best_dist = (uint)-1; |