diff options
author | smatz <smatz@openttd.org> | 2009-01-10 15:54:07 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-01-10 15:54:07 +0000 |
commit | 0cd41d1dc62386d15960b5a6f990207caf8d9834 (patch) | |
tree | 28a83cc48e100e71049922e32b22f54c82c409fb /src/town_cmd.cpp | |
parent | 07d1c28025749c97473371d3944a4b5be9fb2751 (diff) | |
download | openttd-0cd41d1dc62386d15960b5a6f990207caf8d9834.tar.xz |
(svn r14958) -Codechange [FS#1923]: when checking for unique names, compare only with manually set names
There are situations that aren't solvable (because of different language files), so if the user really wants to have duplicated name, allow him to do so. It solves desyncs between server and clients using different languages. It behaves the same in SP and MP, so users won't see the different behaviour as a bug (and even checking in SP could be worked around by the user).
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r-- | src/town_cmd.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 4b9de5618..1546f8cb3 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -2103,12 +2103,9 @@ void ClearTownHouse(Town *t, TileIndex tile) static bool IsUniqueTownName(const char *name) { const Town *t; - char buf[512]; FOR_ALL_TOWNS(t) { - SetDParam(0, t->index); - GetString(buf, STR_TOWN, lastof(buf)); - if (strcmp(buf, name) == 0) return false; + if (t->name != NULL && strcmp(t->name, name) == 0) return false; } return true; |