From 764af07a3319e451f54548edeabfe55a6281ca6f Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 10 Feb 2021 22:36:35 +0000 Subject: [PATCH] Fix departure boards not handling unconditional order jumps --- src/departures.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/departures.cpp b/src/departures.cpp index 245e83d3a3..220d643b4c 100644 --- a/src/departures.cpp +++ b/src/departures.cpp @@ -79,6 +79,12 @@ static bool IsArrival(const Order *order, StationID station) { !(order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION)); } +static uint8 GetDepartureConditionalOrderMode(const Order *order) +{ + if (order->GetConditionVariable() == OCV_UNCONDITIONALLY) return 1; + return _settings_client.gui.departure_conditionals; +} + static inline bool VehicleSetNextDepartureTime(DateTicks *previous_departure, uint *waiting_time, const DateTicksScaled date_only_scaled, const Vehicle *v, const Order *order, bool arrived_at_timing_point, schdispatch_cache_t &dept_schedule_last) { if (HasBit(v->vehicle_flags, VF_SCHEDULED_DISPATCH)) { @@ -298,7 +304,7 @@ DepartureList* MakeDepartureList(StationID station, const std::vectorIsType(OT_CONDITIONAL)) { - switch(_settings_client.gui.departure_conditionals) { + switch(GetDepartureConditionalOrderMode(order)) { case 0: { /* Give up */ break; @@ -458,7 +464,7 @@ DepartureList* MakeDepartureList(StationID station, const std::vectorIsType(OT_CONDITIONAL)) { - switch(_settings_client.gui.departure_conditionals) { + switch(GetDepartureConditionalOrderMode(order)) { case 0: { /* Give up */ break; @@ -696,7 +702,7 @@ DepartureList* MakeDepartureList(StationID station, const std::vectorv->GetNumOrders(); i > 0; --i) { /* If the order is a conditional branch, handle it. */ if (order->IsType(OT_CONDITIONAL)) { - switch(_settings_client.gui.departure_conditionals) { + switch(GetDepartureConditionalOrderMode(order)) { case 0: { /* Give up */ break;