summaryrefslogtreecommitdiff
path: root/src/script/api/script_town.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 20:57:51 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 20:57:51 +0000
commit5ff98b45c1f9097f521c95cfa46728e1f39a8f6d (patch)
tree0d77bfbaf5ca7406b93994b211fbdb5ace243b2f /src/script/api/script_town.cpp
parente53b2f2ab0ef24298e3bb511367b344b88a4a4c0 (diff)
downloadopenttd-5ff98b45c1f9097f521c95cfa46728e1f39a8f6d.tar.xz
(svn r23617) -Add: ScriptTown::ExpandTown, to grow a town (GameScript only)
Diffstat (limited to 'src/script/api/script_town.cpp')
-rw-r--r--src/script/api/script_town.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/api/script_town.cpp b/src/script/api/script_town.cpp
index 554d5f7ae..c2c8d442b 100644
--- a/src/script/api/script_town.cpp
+++ b/src/script/api/script_town.cpp
@@ -200,6 +200,14 @@
return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id, town_action, CMD_DO_TOWN_ACTION);
}
+/* static */ bool ScriptTown::ExpandTown(TownID town_id, int houses)
+{
+ EnforcePrecondition(false, IsValidTown(town_id));
+ EnforcePrecondition(false, houses > 0);
+
+ return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id, houses, CMD_EXPAND_TOWN);
+}
+
/* static */ ScriptTown::TownRating ScriptTown::GetRating(TownID town_id, ScriptCompany::CompanyID company_id)
{
if (!IsValidTown(town_id)) return TOWN_RATING_INVALID;