summaryrefslogtreecommitdiff
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
commit7d877c0c0579b349341989418ed680f34843ff5a (patch)
treee259e21fdd710b05ee833b1f687a053fe34e2fe9
parente193349743bf363b355b1d036efbf4e77916816f (diff)
downloadopenttd-7d877c0c0579b349341989418ed680f34843ff5a.tar.xz
(svn r13507) -Fix (r12856): first engine change should've been moved too
-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);