From 1773d0155a291a2a277be4925b57ad95b3757d52 Mon Sep 17 00:00:00 2001 From: James Ross Date: Thu, 21 Dec 2023 16:27:10 +0000 Subject: [PATCH] Cleanup: Ensure that separation happens at station with load/unload --- src/vehicle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vehicle.cpp b/src/vehicle.cpp index f377efab87..bd9ab662b4 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2383,9 +2383,9 @@ void Vehicle::UpdateAutomaticSeparation() /* Check this feature is enabled on the vehicle's orders */ if (!this->AutomaticSeparationIsEnabled()) return; - /* Only perform the separation at the first manual order (saves on storage) */ + /* Only perform the separation at the first manual order which can load/unload (saves on storage) */ VehicleOrderID first_manual_order = 0; - for (Order *o = this->GetFirstOrder(); o != nullptr && o->IsType(OT_IMPLICIT); o = o->next) { + for (Order *o = this->GetFirstOrder(); o != nullptr && (o->IsType(OT_IMPLICIT) || !o->CanLoadOrUnload()); o = o->next) { ++first_manual_order; } if (this->cur_implicit_order_index != first_manual_order) return;