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
commit554d7d924a97ddbdd2aab09179d918d2a60c17fc (patch)
tree846c321d88d87728ea2a79f3f51c9f621c7f2122
parentb98b97cfb445ead4e3df351489f38c8435a126e9 (diff)
downloadopenttd-554d7d924a97ddbdd2aab09179d918d2a60c17fc.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);
+ }
}