(svn r9494) [NoAI] -Fix: IsRoadTile returns true for all tiles that can be used to traverse a tile. This includes drive through road stops and excluded 'normal' road stations and road depots.
--- a/src/ai/api/ai_road.cpp Tue Mar 27 09:46:59 2007 +0000
+++ b/src/ai/api/ai_road.cpp Tue Mar 27 09:53:18 2007 +0000
@@ -12,7 +12,8 @@
/* Outside of the map */
if (tile >= _map_size) return false;
- return ::IsTileType(tile, MP_STREET) && ::GetRoadTileType(tile) != ROAD_TILE_DEPOT;
+ return (::IsTileType(tile, MP_STREET) && ::GetRoadTileType(tile) != ROAD_TILE_DEPOT) ||
+ this->IsDriveThroughRoadStationTile(tile);
}
bool AIRoad::IsRoadDepotTile(TileIndex tile)
--- a/src/ai/api/ai_road.hpp Tue Mar 27 09:46:59 2007 +0000
+++ b/src/ai/api/ai_road.hpp Tue Mar 27 09:53:18 2007 +0000
@@ -28,7 +28,9 @@
static const char *GetClassName() { return "AIRoad"; }
/**
- * Checks whether the given tile is actually a tile with road.
+ * Checks whether the given tile is actually a tile with road that
+ * can be used to traverse a tile. This excludes road depots and
+ * 'normal' road stations, but includes drive through stations.
* @param tile the tile to check.
* @pre tile is always positive and smaller than AIMap::GetMapSize().
* @return true if and only if the tile has road.