Skip to content

Commit

Permalink
Departures: Fix wrong times for source order with missing travel time
Browse files Browse the repository at this point in the history
In scheduled dispatch mode
  • Loading branch information
JGRennison committed Nov 11, 2024
1 parent 4b939ae commit 1b368c2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/departures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,11 @@ void DepartureListScheduleModeSlotEvaluator::EvaluateSlotIndex(uint slot_index)
/* Loop through the vehicle's orders until we've found a suitable order or we've determined that no such order exists. */
/* We only need to consider each order at most once. */
for (int i = this->v->GetNumOrders(); i > 0; --i) {
/* If an order has a 0 travel time, and it's not explictly set, then stop. */
if (require_travel_time && order->GetTravelTime() == 0 && !order->IsTravelTimetabled() && !order->IsType(OT_IMPLICIT) && !order->IsType(OT_CONDITIONAL)) {
break;
}

departure_tick += order->GetTravelTime();

if (type == D_ARRIVAL && this->calling_settings.IsArrival(order, this->source)) {
Expand Down Expand Up @@ -1481,11 +1486,6 @@ void DepartureListScheduleModeSlotEvaluator::EvaluateSlotIndex(uint slot_index)
break;
}

/* If an order has a 0 travel time, and it's not explictly set, then stop. */
if (require_travel_time && order->GetTravelTime() == 0 && !order->IsTravelTimetabled() && !order->IsType(OT_IMPLICIT)) {
break;
}

if (type == D_ARRIVAL) {
this->arrival_history.push_back({ order, (departure_tick - this->slot).AsTicks() });
}
Expand Down

0 comments on commit 1b368c2

Please sign in to comment.