From cd6ab2c385c06c7b5c42057d3178681692d60d79 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 26 Nov 2022 18:38:26 +0000 Subject: [PATCH] Departure boards: Fix crash with vehicles which only have implicit orders --- src/departures.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/departures.cpp b/src/departures.cpp index b88b0ff23b..1a214bd2ac 100644 --- a/src/departures.cpp +++ b/src/departures.cpp @@ -279,8 +279,11 @@ DepartureList* MakeDepartureList(StationID station, const std::vectorGetOrder(v->cur_real_order_index); const Order *real_timetable_order = v->GetOrder(v->cur_timetable_order_index); - assert(real_timetable_order->IsType(OT_CONDITIONAL)); - start_date += (real_timetable_order->GetWaitTime() - real_current_order->GetTravelTime()); + if (real_timetable_order->IsType(OT_CONDITIONAL)) { + start_date += (real_timetable_order->GetWaitTime() - real_current_order->GetTravelTime()); + } else { + /* This can also occur with implicit orders, when there are no real orders, do nothing */ + } } DepartureStatus status = D_TRAVELLING; bool should_reset_lateness = false;