Changeset - r21184:56d4d70bc490
[Not reviewed]
master
0 1 0
frosch - 10 years ago 2014-01-20 22:34:22
frosch@openttd.org
(svn r26270) -Fix-ish: If ScriptTown::FoundTown fails to generate a new random town name, don't bother sending a command, but fail immediately.
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/script/api/script_town.cpp
Show inline comments
 
@@ -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);
 
}
0 comments (0 inline, 0 general)