static */
| 41 | } |
| 42 | |
| 43 | /* static */ bool ScriptTown::SetName(TownID town_id, Text *name) |
| 44 | { |
| 45 | ScriptObjectRef counter(name); |
| 46 | |
| 47 | EnforceDeityMode(false); |
| 48 | EnforcePrecondition(false, IsValidTown(town_id)); |
| 49 | std::string text; |
| 50 | if (name != nullptr) { |
| 51 | text = name->GetDecodedText(); |
| 52 | EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_TOWN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); |
| 53 | } |
| 54 | |
| 55 | return ScriptObject::Command<CMD_RENAME_TOWN>::Do(town_id, text); |
| 56 | } |
| 57 | |
| 58 | /* static */ bool ScriptTown::SetText(TownID town_id, Text *text) |
| 59 | { |
nothing calls this directly
no test coverage detected