summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-06-13 13:28:55 +0000
committerpeter1138 <peter1138@openttd.org>2008-06-13 13:28:55 +0000
commit24d35c58b70b82d4862ce1c6da50a02238ea5f36 (patch)
treee259e21fdd710b05ee833b1f687a053fe34e2fe9 /src
parentf2404ac20f63b26d16203c2e2a26a143d0782495 (diff)
downloadopenttd-24d35c58b70b82d4862ce1c6da50a02238ea5f36.tar.xz
(svn r13507) -Fix (r12856): first engine change should've been moved too
Diffstat (limited to 'src')
-rw-r--r--src/train_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index acf7f7c53..88fa3d194 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -211,6 +211,8 @@ void TrainConsistChanged(Vehicle *v)
u->u.rail.first_engine = v == u ? INVALID_ENGINE : first_engine;
u->u.rail.railtype = rvi_u->railtype;
+ if (IsTrainEngine(u)) first_engine = u->engine_type;
+
/* Set user defined data to its default value */
u->u.rail.user_def_data = rvi_u->user_def_data;
}
@@ -225,8 +227,6 @@ void TrainConsistChanged(Vehicle *v)
if (!HasBit(EngInfo(u->engine_type)->misc_flags, EF_RAIL_TILTS)) train_can_tilt = false;
- if (IsTrainEngine(u)) first_engine = u->engine_type;
-
/* Cache wagon override sprite group. NULL is returned if there is none */
u->u.rail.cached_override = GetWagonOverrideSpriteSet(u->engine_type, u->cargo_type, u->u.rail.first_engine);