From 909e2922238bd8baa767bf22d8ea09e52fd44775 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 30 Oct 2007 17:57:51 +0000 Subject: (svn r11359) -Fix [FS#1381]: shared timetables were not properly refreshed with autofill. --- src/timetable_cmd.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index 101221216..0db355978 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -31,7 +31,9 @@ static void ChangeTimetable(Vehicle *v, VehicleOrderID order_number, uint16 time } } - InvalidateWindow(WC_VEHICLE_TIMETABLE, v->index); + for (v = GetFirstVehicleFromSharedList(v); v != NULL; v = v->next_shared) { + InvalidateWindow(WC_VEHICLE_TIMETABLE, v->index); + } } /** @@ -134,6 +136,10 @@ CommandCost CmdAutofillTimetable(TileIndex tile, uint32 flags, uint32 p1, uint32 } } + for (v = GetFirstVehicleFromSharedList(v); v != NULL; v = v->next_shared) { + InvalidateWindow(WC_VEHICLE_TIMETABLE, v->index); + } + return CommandCost(); } @@ -178,5 +184,7 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling) v->lateness_counter -= (timetabled - time_taken); - InvalidateWindow(WC_VEHICLE_TIMETABLE, v->index); + for (v = GetFirstVehicleFromSharedList(v); v != NULL; v = v->next_shared) { + InvalidateWindow(WC_VEHICLE_TIMETABLE, v->index); + } } -- cgit v1.2.3-70-g09d2