From 24d35c58b70b82d4862ce1c6da50a02238ea5f36 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Fri, 13 Jun 2008 13:28:55 +0000 Subject: (svn r13507) -Fix (r12856): first engine change should've been moved too --- src/train_cmd.cpp | 4 ++-- 1 file 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); -- cgit v1.2.3-70-g09d2