summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);