summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-06-02 11:15:38 +0000
committermaedhros <maedhros@openttd.org>2007-06-02 11:15:38 +0000
commit1e7b8190f2ad02d1572b28308473dc7696ea9b0e (patch)
tree20deb8b9ba8830ee419410b8035c4496aafb81a6 /src
parent62c20a969886a30ff4b2459e072d6316e08d042d (diff)
downloadopenttd-1e7b8190f2ad02d1572b28308473dc7696ea9b0e.tar.xz
(svn r10022) -Fix (r10007): Set the type of multiheaded trains before the subtype.
Diffstat (limited to 'src')
-rw-r--r--src/train_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index b7e597059..9f8318a55 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -626,6 +626,7 @@ static void AddRearEngineToMultiheadedTrain(Vehicle* v, Vehicle* u, bool buildin
u->z_pos = v->z_pos;
u->u.rail.track = TRACK_BIT_DEPOT;
u->vehstatus = v->vehstatus & ~VS_STOPPED;
+ u = new (u) Train();
u->subtype = 0;
SetMultiheaded(u);
u->spritenum = v->spritenum + 1;
@@ -638,7 +639,6 @@ static void AddRearEngineToMultiheadedTrain(Vehicle* v, Vehicle* u, bool buildin
u->build_year = v->build_year;
if (building) v->value >>= 1;
u->value = v->value;
- u = new (u) Train();
u->cur_image = 0xAC2;
u->random_bits = VehicleRandomBits();
VehiclePositionChanged(u);