diff options
author | Yexo <Yexo@openttd.org> | 2009-02-04 23:26:21 +0000 |
---|---|---|
committer | Yexo <Yexo@openttd.org> | 2009-02-04 23:26:21 +0000 |
commit | 70a38e8a60a50452dc47a7576179f300efad46e8 (patch) | |
tree | e10fe107bf45eb727992bbee48cb0f0d8554fef1 /src/ai/api/ai_town.cpp | |
parent | e80255c4ae1bcdf925e5787eab4a9213dcb97c73 (diff) | |
download | openttd-70a38e8a60a50452dc47a7576179f300efad46e8.tar.xz |
(svn r15343) -Add [NoAI]: Add AITown::GetRoadLayout so AIs can get the road layout per town.
Diffstat (limited to 'src/ai/api/ai_town.cpp')
-rw-r--r-- | src/ai/api/ai_town.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ai/api/ai_town.cpp b/src/ai/api/ai_town.cpp index 60fbdb799..117c35f39 100644 --- a/src/ai/api/ai_town.cpp +++ b/src/ai/api/ai_town.cpp @@ -192,3 +192,10 @@ } return max(0, 2 - num); } + +/* static */ AITown::RoadLayout AITown::GetRoadLayout(TownID town_id) +{ + if (!IsValidTown(town_id)) return ROAD_LAYOUT_INVALID; + + return (AITown::RoadLayout)((TownLayout)::GetTown(town_id)->layout); +} |