diff options
author | frosch <frosch@openttd.org> | 2014-07-16 22:24:55 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2014-07-16 22:24:55 +0000 |
commit | 86c43ca183616da63f01f283652e5d3fce141b97 (patch) | |
tree | 4a4efd658f6dd83bfcaedb1803c5f98ed1a35be3 /src | |
parent | 8701514172691c6efe2ef5ea0b51d1b31f656501 (diff) | |
download | openttd-86c43ca183616da63f01f283652e5d3fce141b97.tar.xz |
(svn r26694) -Fix (r26547) [FS#6063]: When orders become invalid, reset the waiting time, but keep the travel time.
Diffstat (limited to 'src')
-rw-r--r-- | src/order_cmd.cpp | 12 |
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)); |