diff options
author | frosch <frosch@openttd.org> | 2009-05-02 00:10:24 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-05-02 00:10:24 +0000 |
commit | d518b3d0acf38509813daa0614559d267f196154 (patch) | |
tree | b63f38d5da1c67e9a037b28ffdc0f043387b33e5 /src/order_cmd.cpp | |
parent | a22ff74ef205dc3409c7e743d24892960cdbb0b1 (diff) | |
download | openttd-d518b3d0acf38509813daa0614559d267f196154.tar.xz |
(svn r16199) -Codechange: Pass OrderNonStopFlags also to MakeGoToDepotOrder().
-Fix: 'Go non-stop to nearest depot'-orders did not work wrt. the 'non-stop' part.
-Fix: Adding 'Go to nearest depot'-orders did not respect the default setting for 'non-stop'.
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r-- | src/order_cmd.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index b89c7ff89..18a8ef73f 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -51,14 +51,12 @@ void Order::MakeGoToStation(StationID destination) this->dest = destination; } -void Order::MakeGoToDepot(DepotID destination, OrderDepotTypeFlags order, OrderDepotActionFlags action, CargoID cargo, byte subtype) +void Order::MakeGoToDepot(DepotID destination, OrderDepotTypeFlags order, OrderNonStopFlags non_stop_type, OrderDepotActionFlags action, CargoID cargo, byte subtype) { this->type = OT_GOTO_DEPOT; this->SetDepotOrderType(order); this->SetDepotActionType(action); - if (!(order & ODTFB_PART_OF_ORDERS)) { - this->SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS); - } + this->SetNonStopType(non_stop_type); this->dest = destination; this->SetRefit(cargo, subtype); } @@ -1644,7 +1642,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth) if (v->FindClosestDepot(&location, &destination, &reverse)) { v->dest_tile = location; - v->current_order.MakeGoToDepot(destination, v->current_order.GetDepotOrderType(), (OrderDepotActionFlags)(v->current_order.GetDepotActionType() & ~ODATFB_NEAREST_DEPOT), v->current_order.GetRefitCargo(), v->current_order.GetRefitSubtype()); + v->current_order.MakeGoToDepot(destination, v->current_order.GetDepotOrderType(), v->current_order.GetNonStopType(), (OrderDepotActionFlags)(v->current_order.GetDepotActionType() & ~ODATFB_NEAREST_DEPOT), v->current_order.GetRefitCargo(), v->current_order.GetRefitSubtype()); /* If there is no depot in front, reverse automatically (trains only) */ if (v->type == VEH_TRAIN && reverse) DoCommand(v->tile, v->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION); |