(svn r14192) -Fix [FS#2236]: properly update the current timetable's travel/wait times instead of only doing it for one vehicle in the shared order chain and only when some bit has not been set (PhilSophus)
authorrubidium
Sat, 30 Aug 2008 10:26:16 +0000
changeset 10033 0336744fb8a6
parent 10032 1f6c6f3bea28
child 10034 31baa7c207b8
(svn r14192) -Fix [FS#2236]: properly update the current timetable's travel/wait times instead of only doing it for one vehicle in the shared order chain and only when some bit has not been set (PhilSophus)
src/timetable_cmd.cpp
--- a/src/timetable_cmd.cpp	Sat Aug 30 09:46:52 2008 +0000
+++ b/src/timetable_cmd.cpp	Sat Aug 30 10:26:16 2008 +0000
@@ -24,15 +24,14 @@
 		order->wait_time = time;
 	}
 
-	if (v->cur_order_index == order_number && v->current_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) {
-		if (is_journey) {
-			v->current_order.travel_time = time;
-		} else {
-			v->current_order.wait_time = time;
+	for (v = v->FirstShared(); v != NULL; v = v->NextShared()) {
+		if (v->cur_order_index == order_number && v->current_order.Equals(*order)) {
+			if (is_journey) {
+				v->current_order.travel_time = time;
+			} else {
+				v->current_order.wait_time = time;
+			}
 		}
-	}
-
-	for (v = v->FirstShared(); v != NULL; v = v->NextShared()) {
 		InvalidateWindow(WC_VEHICLE_TIMETABLE, v->index);
 	}
 }