diff options
author | rubidium <rubidium@openttd.org> | 2010-12-05 22:25:21 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-12-05 22:25:21 +0000 |
commit | 5c9c3f1acf9a49b8da6fcbea0e4072750181a48c (patch) | |
tree | 2a5c4d4e8be234c7024da472f2fe9d5344417fe9 /src/town_cmd.cpp | |
parent | 6e69b943d685c3b485d415d4fce53af28f0eba85 (diff) | |
download | openttd-5c9c3f1acf9a49b8da6fcbea0e4072750181a48c.tar.xz |
(svn r21414) -Codechange: limit town name by amount of characters, not bytes
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r-- | src/town_cmd.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index bf2ea082b..9ab7eacda 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -1543,7 +1543,7 @@ CommandCost CmdFoundTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 if (!VerifyTownName(townnameparts, &par)) return_cmd_error(STR_ERROR_NAME_MUST_BE_UNIQUE); } else { /* If name is not empty, it has to be unique custom name */ - if (strlen(text) >= MAX_LENGTH_TOWN_NAME_BYTES) return CMD_ERROR; + if (Utf8StringLength(text) >= MAX_LENGTH_TOWN_NAME_CHARS) return CMD_ERROR; if (!IsUniqueTownName(text)) return_cmd_error(STR_ERROR_NAME_MUST_BE_UNIQUE); } @@ -2295,7 +2295,7 @@ CommandCost CmdRenameTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 bool reset = StrEmpty(text); if (!reset) { - if (strlen(text) >= MAX_LENGTH_TOWN_NAME_BYTES) return CMD_ERROR; + if (Utf8StringLength(text) >= MAX_LENGTH_TOWN_NAME_CHARS) return CMD_ERROR; if (!IsUniqueTownName(text)) return_cmd_error(STR_ERROR_NAME_MUST_BE_UNIQUE); } |