diff options
author | frosch <frosch@openttd.org> | 2011-04-16 16:56:24 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-04-16 16:56:24 +0000 |
commit | 709f0e4f8390bffce0a1a26c86c91e0e8cd9fa07 (patch) | |
tree | ca4a5903184b3c2bd604a57e5af0bf071907b0e3 /src/vehicle.cpp | |
parent | 194a941a3740dd3d941d053712ea208ba331f5aa (diff) | |
download | openttd-709f0e4f8390bffce0a1a26c86c91e0e8cd9fa07.tar.xz |
(svn r22329) -Change: When the current orders are interrupted for non-ordered service, disable modifications to automatic orders until the next real order is completed. (train part already slipped by in r22328)
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 81880f3c3..66e858107 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1986,6 +1986,11 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command) * then skip to the next order; effectively cancelling this forced service */ if (this->current_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) this->IncrementRealOrderIndex(); + if (this->IsGroundVehicle()) { + uint16 &gv_flags = this->GetGroundVehicleFlags(); + SetBit(gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS); + } + this->current_order.MakeDummy(); SetWindowWidgetDirty(WC_VEHICLE_VIEW, this->index, VVW_WIDGET_START_STOP_VEH); } @@ -2001,6 +2006,11 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command) if (flags & DC_EXEC) { if (this->current_order.IsType(OT_LOADING)) this->LeaveStation(); + if (this->IsGroundVehicle()) { + uint16 &gv_flags = this->GetGroundVehicleFlags(); + SetBit(gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS); + } + this->dest_tile = location; this->current_order.MakeGoToDepot(destination, ODTF_MANUAL); if (!(command & DEPOT_SERVICE)) this->current_order.SetDepotActionType(ODATFB_HALT); |