Fix crash when road vehicle leaves bus/truck stop when it is has no orders

pull/379/head
Jonathan G Rennison 2 years ago
parent f86f77b7a5
commit a8d99215d7

@ -1568,6 +1568,8 @@ inline byte IncreaseOvertakingCounter(RoadVehicle *v)
static bool CheckRestartLoadingAtRoadStop(RoadVehicle *v)
{
if (v->GetNumOrders() < 1) return false;
StationID station_id = v->current_order.GetDestination();
VehicleOrderID next_order_idx = AdvanceOrderIndexDeferred(v, v->cur_implicit_order_index);
const Order *next_order = v->GetOrder(next_order_idx);

Loading…
Cancel
Save