Check that order is station type when comparing with last_station_visited

pull/507/head
Jonathan G Rennison 1 year ago
parent da97e0d170
commit 0370f2e3f1

@ -677,7 +677,8 @@ CargoMaskedStationIDStack OrderList::GetNextStoppingStation(const Vehicle *v, Ca
});
if (invalid) return CargoMaskedStationIDStack(cargo_mask, INVALID_STATION);
}
} while (next->IsType(OT_GOTO_DEPOT) || next->IsType(OT_RELEASE_SLOT) || next->IsType(OT_COUNTER) || next->IsType(OT_DUMMY) || next->GetDestination() == v->last_station_visited);
} while (next->IsType(OT_GOTO_DEPOT) || next->IsType(OT_RELEASE_SLOT) || next->IsType(OT_COUNTER) || next->IsType(OT_DUMMY)
|| (next->IsBaseStationOrder() && next->GetDestination() == v->last_station_visited));
return CargoMaskedStationIDStack(cargo_mask, next->GetDestination());
}

@ -53,7 +53,7 @@ static void ChangeTimetable(Vehicle *v, VehicleOrderID order_number, uint32 val,
order->SetWaitTimetabled(timetabled);
if (HasBit(v->vehicle_flags, VF_SCHEDULED_DISPATCH) && timetabled && order->IsScheduledDispatchOrder(true)) {
for (Vehicle *u = v->FirstShared(); u != nullptr; u = u->NextShared()) {
if (u->cur_implicit_order_index == order_number && (u->last_station_visited == order->GetDestination())) {
if (u->cur_implicit_order_index == order_number && order->IsBaseStationOrder() && u->last_station_visited == order->GetDestination()) {
u->lateness_counter += timetable_delta;
}
}

Loading…
Cancel
Save