diff options
author | truebrain <truebrain@openttd.org> | 2011-12-19 21:06:06 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-12-19 21:06:06 +0000 |
commit | 102f811d0277afefe5c90762c0c4cc11ab69713c (patch) | |
tree | 1c7343e8031eab2c764cff974bd9df9a814c3dd9 /src/script/api/script_town.cpp | |
parent | b0ac529a6ff4e087520a14d2a0169f445952e7e0 (diff) | |
download | openttd-102f811d0277afefe5c90762c0c4cc11ab69713c.tar.xz |
(svn r23636) -Add: introduce ScriptText in parameters where it can be used
Diffstat (limited to 'src/script/api/script_town.cpp')
-rw-r--r-- | src/script/api/script_town.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/script/api/script_town.cpp b/src/script/api/script_town.cpp index e1c0c0a85..c04115c8f 100644 --- a/src/script/api/script_town.cpp +++ b/src/script/api/script_town.cpp @@ -43,10 +43,14 @@ return town_name; } -/* static */ bool ScriptTown::SetText(TownID town_id, const char *text) +/* static */ bool ScriptTown::SetText(TownID town_id, Text *text) { + CCountedPtr<Text> counter(text); + + EnforcePrecondition(false, text != NULL); EnforcePrecondition(false, IsValidTown(town_id)); - return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id, 0, CMD_TOWN_SET_TEXT, text); + + return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id, 0, CMD_TOWN_SET_TEXT, text->GetEncodedText()); } /* static */ int32 ScriptTown::GetPopulation(TownID town_id) |