From 4991309018c9601c8b60579e6580698b09e01e34 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 17 May 2022 20:31:21 +0100 Subject: [PATCH] Fix timetable autofill activation when scheduled dispatch is active --- src/timetable_cmd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index e478d0d4db..66b9fd6828 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -834,6 +834,7 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling) const int wait_offset = real_current_order->GetTimetabledWait(); DateTicksScaled slot = GetScheduledDispatchTime(ds, _scaled_date_ticks + wait_offset); if (slot > -1) { + just_started = !HasBit(v->vehicle_flags, VF_TIMETABLE_STARTED); SetBit(v->vehicle_flags, VF_TIMETABLE_STARTED); v->lateness_counter = _scaled_date_ticks - slot + wait_offset; ds.SetScheduledDispatchLastDispatch(slot - ds.GetScheduledDispatchStartTick()); @@ -859,7 +860,7 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling) * the vehicle last arrived at the first destination, update it to the * current time. Otherwise set the late counter appropriately to when * the vehicle should have arrived. */ - just_started = !HasBit(v->vehicle_flags, VF_TIMETABLE_STARTED); + if (!set_scheduled_dispatch) just_started = !HasBit(v->vehicle_flags, VF_TIMETABLE_STARTED); if (v->timetable_start != 0) { v->lateness_counter = _scaled_date_ticks - ((_settings_game.economy.day_length_factor * ((DateTicksScaled) v->timetable_start)) + v->timetable_start_subticks);