diff options
author | frosch <frosch@openttd.org> | 2008-02-14 15:59:16 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-02-14 15:59:16 +0000 |
commit | 514df81e27398309532f7523ee1c7df86fe3043d (patch) | |
tree | a43464406df621d20a7dd83755ef86ae3474e9ea /src/ai/trolly | |
parent | 6c932166414ac0164fc53658b880d5b05a9d7a7e (diff) | |
download | openttd-514df81e27398309532f7523ee1c7df86fe3043d.tar.xz |
(svn r12141) -Codechange: Introduce IsNormalRoad[Tile](), IsRoadDepot[Tile]() and HasTileRoadType(); and use them.
Diffstat (limited to 'src/ai/trolly')
-rw-r--r-- | src/ai/trolly/trolly.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ai/trolly/trolly.cpp b/src/ai/trolly/trolly.cpp index 8f62b7e95..1a5a0fce4 100644 --- a/src/ai/trolly/trolly.cpp +++ b/src/ai/trolly/trolly.cpp @@ -801,8 +801,7 @@ static void AiNew_State_FindDepot(Player *p) for (j = DIAGDIR_BEGIN; j < DIAGDIR_END; j++) { TileIndex t = tile + TileOffsByDiagDir(j); - if (IsTileType(t, MP_ROAD) && - GetRoadTileType(t) == ROAD_TILE_DEPOT && + if (IsRoadDepotTile(t) && IsTileOwner(t, _current_player) && GetRoadDepotDirection(t) == ReverseDiagDir(j)) { _players_ainew[p->index].depot_tile = t; @@ -1102,7 +1101,7 @@ static void AiNew_State_BuildDepot(Player *p) CommandCost res; assert(_players_ainew[p->index].state == AI_STATE_BUILD_DEPOT); - if (IsTileType(_players_ainew[p->index].depot_tile, MP_ROAD) && GetRoadTileType(_players_ainew[p->index].depot_tile) == ROAD_TILE_DEPOT) { + if (IsRoadDepotTile(_players_ainew[p->index].depot_tile)) { if (IsTileOwner(_players_ainew[p->index].depot_tile, _current_player)) { // The depot is already built _players_ainew[p->index].state = AI_STATE_BUILD_VEHICLE; |