mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 10:30:28 +00:00
(svn r25544) -Fix [FS#5625] (r25488, r25486): [GS] The checks and validations for setting the extra text in the town window became too stringent
This commit is contained in:
parent
c1bf3122ad
commit
1ff95f36bf
@ -43,10 +43,9 @@
|
|||||||
CCountedPtr<Text> counter(text);
|
CCountedPtr<Text> counter(text);
|
||||||
|
|
||||||
EnforcePrecondition(false, text != NULL);
|
EnforcePrecondition(false, text != NULL);
|
||||||
const char *encoded_text = text->GetDecodedText();
|
const char *encoded_text = text->GetEncodedText();
|
||||||
EnforcePreconditionEncodedText(false, encoded_text);
|
EnforcePreconditionEncodedText(false, encoded_text);
|
||||||
EnforcePrecondition(false, IsValidTown(town_id));
|
EnforcePrecondition(false, IsValidTown(town_id));
|
||||||
EnforcePreconditionCustomError(false, ::Utf8StringLength(encoded_text) < MAX_LENGTH_TOWN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG);
|
|
||||||
|
|
||||||
return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id, 0, CMD_TOWN_SET_TEXT, encoded_text);
|
return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id, 0, CMD_TOWN_SET_TEXT, encoded_text);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user