summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-10-30 17:57:51 +0000
committerrubidium <rubidium@openttd.org>2007-10-30 17:57:51 +0000
commit909e2922238bd8baa767bf22d8ea09e52fd44775 (patch)
tree846c321d88d87728ea2a79f3f51c9f621c7f2122
parent50d51e83bb2d44be0abc5321fcde736e9f02e7f9 (diff)
downloadopenttd-909e2922238bd8baa767bf22d8ea09e52fd44775.tar.xz
(svn r11359) -Fix [FS#1381]: shared timetables were not properly refreshed with autofill.
-rw-r--r--src/timetable_cmd.cpp12
1 files 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);
+ }
}