summaryrefslogtreecommitdiff
path: root/src/rail_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r--src/rail_cmd.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 8d3dec5e5..49a58fe6d 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -99,6 +99,9 @@ RailType AllocateRailType(RailTypeLabel label)
/* Set up new rail type */
memcpy(rti, &_railtypes[RAILTYPE_RAIL], sizeof(*rti));
rti->label = label;
+ /* Clear alternate label list. Can't use Reset() here as that would free
+ * the data pointer of RAILTYPE_RAIL and not our new rail type. */
+ new (&rti->alternate_labels) RailTypeLabelList;
/* Make us compatible with ourself. */
rti->powered_railtypes = (RailTypes)(1 << rt);