summaryrefslogtreecommitdiff
path: root/src/waypoint.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-10 15:54:07 +0000
committersmatz <smatz@openttd.org>2009-01-10 15:54:07 +0000
commitc5db2ea1811356709c20de20c16fc98cf010df3d (patch)
tree28a83cc48e100e71049922e32b22f54c82c409fb /src/waypoint.cpp
parent818b162b350a98c240c57b99cf54b1c6eff84d07 (diff)
downloadopenttd-c5db2ea1811356709c20de20c16fc98cf010df3d.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/waypoint.cpp')
-rw-r--r--src/waypoint.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/waypoint.cpp b/src/waypoint.cpp
index 061eca795..6ae6aa6b1 100644
--- a/src/waypoint.cpp
+++ b/src/waypoint.cpp
@@ -336,12 +336,9 @@ CommandCost CmdRemoveTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint
static bool IsUniqueWaypointName(const char *name)
{
const Waypoint *wp;
- char buf[512];
FOR_ALL_WAYPOINTS(wp) {
- SetDParam(0, wp->index);
- GetString(buf, STR_WAYPOINT_RAW, lastof(buf));
- if (strcmp(buf, name) == 0) return false;
+ if (wp->name != NULL && strcmp(wp->name, name) == 0) return false;
}
return true;