summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_town.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai/api/ai_town.cpp')
-rw-r--r--src/ai/api/ai_town.cpp7
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);
+}