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 05615e485..85bc22a53 100644
--- a/src/ai/api/ai_town.cpp
+++ b/src/ai/api/ai_town.cpp
@@ -129,6 +129,13 @@
return ::HasBit(::Town::Get(town_id)->statues, _current_company);
}
+/* static */ bool AITown::IsCity(TownID town_id)
+{
+ if (!IsValidTown(town_id)) return false;
+
+ return ::Town::Get(town_id)->larger_town;
+}
+
/* static */ int AITown::GetRoadReworkDuration(TownID town_id)
{
if (!IsValidTown(town_id)) return -1;