(svn r21416) -Codechange: limit vehicle name by amount of characters, not bytes

This commit is contained in:
rubidium
2010-12-05 22:25:49 +00:00
parent 44d1c55347
commit ea68039718
4 changed files with 4 additions and 4 deletions

View File

@@ -882,7 +882,7 @@ CommandCost CmdRenameVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
bool reset = StrEmpty(text);
if (!reset) {
if (strlen(text) >= MAX_LENGTH_VEHICLE_NAME_BYTES) return CMD_ERROR;
if (Utf8StringLength(text) >= MAX_LENGTH_VEHICLE_NAME_CHARS) return CMD_ERROR;
if (!(flags & DC_AUTOREPLACE) && !IsUniqueVehicleName(text)) return_cmd_error(STR_ERROR_NAME_MUST_BE_UNIQUE);
}