summaryrefslogtreecommitdiff
path: root/src/script/api/script_town.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-11-12 17:57:32 +0000
committerfrosch <frosch@openttd.org>2013-11-12 17:57:32 +0000
commit17eb3ee9df210e5a8777fcbc289c2756ed56ef14 (patch)
tree364339e4eb0f43ebd892714effb5739ab3ed1f91 /src/script/api/script_town.cpp
parent9a41aefcc4a75ca98dd73e022d058b52bbd2a26d (diff)
downloadopenttd-17eb3ee9df210e5a8777fcbc289c2756ed56ef14.tar.xz
(svn r25969) -Add: [Script] ScriptTown::GetFundBuildingsDuration.
Diffstat (limited to 'src/script/api/script_town.cpp')
-rw-r--r--src/script/api/script_town.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/script/api/script_town.cpp b/src/script/api/script_town.cpp
index 5d67cb76d..8fd033e9e 100644
--- a/src/script/api/script_town.cpp
+++ b/src/script/api/script_town.cpp
@@ -228,6 +228,13 @@
return ::Town::Get(town_id)->road_build_months;
}
+/* static */ int ScriptTown::GetFundBuildingsDuration(TownID town_id)
+{
+ if (!IsValidTown(town_id)) return -1;
+
+ return ::Town::Get(town_id)->fund_buildings_months;
+}
+
/* static */ ScriptCompany::CompanyID ScriptTown::GetExclusiveRightsCompany(TownID town_id)
{
if (ScriptObject::GetCompany() == OWNER_DEITY) return ScriptCompany::COMPANY_INVALID;