mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-07 06:39:08 +00:00
(svn r26270) -Fix-ish: If ScriptTown::FoundTown fails to generate a new random town name, don't bother sending a command, but fail immediately.
This commit is contained in:
parent
efe6adba6a
commit
f36d084db5
@ -298,7 +298,10 @@
|
||||
EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_TOWN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG);
|
||||
}
|
||||
uint32 townnameparts;
|
||||
GenerateTownName(&townnameparts);
|
||||
if (!GenerateTownName(&townnameparts)) {
|
||||
ScriptObject::SetLastError(ScriptError::ERR_NAME_IS_NOT_UNIQUE);
|
||||
return false;
|
||||
}
|
||||
|
||||
return ScriptObject::DoCommand(tile, size | (city ? 1 << 2 : 0) | layout << 3, townnameparts, CMD_FOUND_TOWN, text);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user