summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_town.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-12-29 12:19:33 +0000
committeryexo <yexo@openttd.org>2010-12-29 12:19:33 +0000
commit399a9641fe161fd631a26b7faa0ce63fc136219b (patch)
tree8cfe5ba66f57fc547b1f5ae7426cfe3151df0415 /src/ai/api/ai_town.cpp
parent0d613156e725a2e38e915b7048ab1e9ac5b3cae5 (diff)
downloadopenttd-399a9641fe161fd631a26b7faa0ce63fc136219b.tar.xz
(svn r21654) -Add: [NoAI] AITown::IsCity() so AIs can find out which towns grow faster than others (Lord Aro)
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;