summaryrefslogtreecommitdiff
path: root/src/rail_cmd.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2012-01-05 19:40:34 +0000
committermichi_cc <michi_cc@openttd.org>2012-01-05 19:40:34 +0000
commitee0fcb25670d1b559cdfdb31e6b7d0da4ec3713d (patch)
tree6801ecd572e6dd07d0b4b045cdcbd1bafea78617 /src/rail_cmd.cpp
parent69e197c87fc23e5492f4b59f8e1ba8757d65c41e (diff)
downloadopenttd-ee0fcb25670d1b559cdfdb31e6b7d0da4ec3713d.tar.xz
(svn r23758) -Feature: [NewGRF] Alternate rail type label list.
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);