(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. noai
authorrubidium
Tue, 27 Mar 2007 09:53:18 +0000
branchnoai
changeset 9556 65417763fa24
parent 9555 00ccc64d342c
child 9557 a3e1a25cf3d3
(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.
src/ai/api/ai_road.cpp
src/ai/api/ai_road.hpp
--- 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.