@@ -42,13 +42,13 @@
/* static */ bool ScriptTown::SetName(TownID town_id, Text *name)
{
CCountedPtr<Text> counter(name);
const char *text = NULL;
if (name != NULL) {
const char *text = name->GetDecodedText();
text = name->GetDecodedText();
EnforcePreconditionEncodedText(false, text);
EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_TOWN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG);
}
EnforcePrecondition(false, IsValidTown(town_id));
return ScriptObject::DoCommand(0, town_id, 0, CMD_RENAME_TOWN, text);
Status change: