summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-09-16 16:31:57 +0000
committerrubidium <rubidium@openttd.org>2010-09-16 16:31:57 +0000
commitaf18c30f30d550b98f7fe3dc89c8977a2aeb7f51 (patch)
tree9c154aa95356c740d333b8f92ee34259272cc914 /src/saveload
parentb01c63cd23b3c60de3b48478b5287cdaeffed974 (diff)
downloadopenttd-af18c30f30d550b98f7fe3dc89c8977a2aeb7f51.tar.xz
(svn r20816) -Codechange [FS#3835]: make waypoint default names work like depots, stations and vehicles (Krille)
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 61183f30c..348cbb6c6 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -2295,6 +2295,19 @@ bool AfterLoadGame()
SetWaterClass(t, WATER_CLASS_INVALID);
}
}
+
+ /* Waypoints with custom name may have a non-unique town_cn,
+ * renumber those. First set all affected waypoints to the
+ * highest possible number to get them numbered in the
+ * order they have in the pool. */
+ Waypoint *wp;
+ FOR_ALL_WAYPOINTS(wp) {
+ if (wp->name != NULL) wp->town_cn = UINT16_MAX;
+ }
+
+ FOR_ALL_WAYPOINTS(wp) {
+ if (wp->name != NULL) MakeDefaultName(wp);
+ }
}
/* Road stops is 'only' updating some caches */