From 2209c6a344328040757e84a38c36427ed214875a Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 21 Nov 2008 18:16:19 +0000 Subject: (svn r14601) -Fix: the nearest depot and stop in depot orders didn't work together (the vehicle didn't stop). --- src/order_cmd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/order_cmd.cpp') diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index f26b70b87..9d7f855ff 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -57,11 +57,11 @@ void Order::MakeGoToStation(StationID destination) this->dest = destination; } -void Order::MakeGoToDepot(DepotID destination, OrderDepotTypeFlags order, CargoID cargo, byte subtype) +void Order::MakeGoToDepot(DepotID destination, OrderDepotTypeFlags order, OrderDepotActionFlags action, CargoID cargo, byte subtype) { this->type = OT_GOTO_DEPOT; - this->flags = 0; this->SetDepotOrderType(order); + this->SetDepotActionType(action); if (!(order & ODTFB_PART_OF_ORDERS)) { this->SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS); } @@ -1623,7 +1623,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(), v->current_order.GetRefitCargo(), v->current_order.GetRefitSubtype()); + 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()); /* 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); -- cgit v1.2.3-70-g09d2