Continue waiting at rail waypoint if next order is a wait order for the same waypoint

This commit is contained in:
Jonathan G Rennison
2020-05-10 17:06:45 +01:00
parent 0100ea4e32
commit 0dd9562ead

View File

@@ -4952,6 +4952,18 @@ static bool TrainLocoHandler(Train *v, bool mode)
if (v->current_order.IsType(OT_WAITING) && v->reverse_distance == 0) { if (v->current_order.IsType(OT_WAITING) && v->reverse_distance == 0) {
v->HandleWaiting(false); v->HandleWaiting(false);
if (v->current_order.IsType(OT_WAITING)) return true; if (v->current_order.IsType(OT_WAITING)) return true;
ProcessOrders(v);
if (IsRailWaypointTile(v->tile)) {
StationID station_id = GetStationIndex(v->tile);
if (v->current_order.ShouldStopAtStation(v, station_id, true)) {
UpdateVehicleTimetable(v, true);
v->last_station_visited = station_id;
SetWindowDirty(WC_VEHICLE_VIEW, v->index);
v->current_order.MakeWaiting();
v->current_order.SetNonStopType(ONSF_NO_STOP_AT_ANY_STATION);
return true;
}
}
} }
if (!mode) v->ShowVisualEffect(); if (!mode) v->ShowVisualEffect();