mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-04 13:23:46 +00:00
(svn r14957) -Fix [FS#2516]: Do not abort train movement, when we are just about to reach the end of the platform.
This commit is contained in:
parent
db546e607f
commit
07d1c28025
@ -3670,6 +3670,7 @@ static void TrainController(Vehicle *v, Vehicle *nomove, bool update_image)
|
|||||||
} else {
|
} else {
|
||||||
/* Not inside depot */
|
/* 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;
|
if (IsFrontEngine(v) && !TrainCheckIfLineEnds(v)) return;
|
||||||
|
|
||||||
uint32 r = VehicleEnterTile(v, gp.new_tile, gp.x, gp.y);
|
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;
|
goto invalid_rail;
|
||||||
}
|
}
|
||||||
if (HasBit(r, VETS_ENTERED_STATION)) {
|
if (HasBit(r, VETS_ENTERED_STATION)) {
|
||||||
|
/* The new position is the end of the platform */
|
||||||
TrainEnterStation(v, r >> VETS_STATION_ID_OFFSET);
|
TrainEnterStation(v, r >> VETS_STATION_ID_OFFSET);
|
||||||
return;
|
} else if (v->current_order.IsType(OT_LEAVESTATION)) {
|
||||||
}
|
|
||||||
|
|
||||||
if (v->current_order.IsType(OT_LEAVESTATION)) {
|
|
||||||
v->current_order.Free();
|
v->current_order.Free();
|
||||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user