From 07d1c28025749c97473371d3944a4b5be9fb2751 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 10 Jan 2009 15:27:57 +0000 Subject: (svn r14957) -Fix [FS#2516]: Do not abort train movement, when we are just about to reach the end of the platform. --- src/train_cmd.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index dc9d3c993..8fc439dd5 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -3670,6 +3670,7 @@ static void TrainController(Vehicle *v, Vehicle *nomove, bool update_image) } else { /* Not inside depot */ + /* Reverse when we are at the end of the track already, do not move to the new position */ if (IsFrontEngine(v) && !TrainCheckIfLineEnds(v)) return; uint32 r = VehicleEnterTile(v, gp.new_tile, gp.x, gp.y); @@ -3677,11 +3678,9 @@ static void TrainController(Vehicle *v, Vehicle *nomove, bool update_image) goto invalid_rail; } if (HasBit(r, VETS_ENTERED_STATION)) { + /* The new position is the end of the platform */ TrainEnterStation(v, r >> VETS_STATION_ID_OFFSET); - return; - } - - if (v->current_order.IsType(OT_LEAVESTATION)) { + } else if (v->current_order.IsType(OT_LEAVESTATION)) { v->current_order.Free(); InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); } -- cgit v1.2.3-70-g09d2