summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/order_cmd.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index f3a6d91d6..57b29f3f5 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -1870,7 +1870,19 @@ restart:
break;
}
+ /* Clear wait time */
+ v->orders.list->UpdateTotalDuration(-order->GetWaitTime());
+ if (order->IsWaitTimetabled()) {
+ v->orders.list->UpdateTimetableDuration(-order->GetTimetabledWait());
+ order->SetWaitTimetabled(false);
+ }
+ order->SetWaitTime(0);
+
+ /* Clear order, preserving travel time */
+ bool travel_timetabled = order->IsTravelTimetabled();
order->MakeDummy();
+ order->SetTravelTimetabled(travel_timetabled);
+
for (const Vehicle *w = v->FirstShared(); w != NULL; w = w->NextShared()) {
/* In GUI, simulate by removing the order and adding it back */
InvalidateVehicleOrder(w, id | (INVALID_VEH_ORDER_ID << 8));