summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-02-20 17:49:50 +0000
committerfrosch <frosch@openttd.org>2008-02-20 17:49:50 +0000
commitb7993793c813359ba4963df93d49a80335ddca36 (patch)
treed325400c42801ac23226ccaf0d71008e4e3598ec /src/ai
parent9e651575481dbdd4b587fe22e2d79b998bcbbe15 (diff)
downloadopenttd-b7993793c813359ba4963df93d49a80335ddca36.tar.xz
(svn r12199) -Codechange: Remove magic around the results of GetTileTrackStatus().
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/default/default.cpp7
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;