From 42df5cbc03042b75cab04b634a1c53b3dd87d507 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 24 Oct 2008 14:49:45 +0000 Subject: (svn r14524) -Add: stop-in-depot as part of orders (PhilSophus) --- src/vehicle.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/vehicle.cpp') diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 1d1a5c4bf..f69951e89 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -725,9 +725,10 @@ void VehicleEnteredDepotThisTick(Vehicle *v) { /* We need to set v->leave_depot_instantly as we have no control of it's contents at this time. * Vehicle should stop in the depot if it was in 'stopping' state - train intered depot while slowing down. */ - if (((v->current_order.GetDepotActionType() & ODATFB_HALT) && !(v->current_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) && v->current_order.IsType(OT_GOTO_DEPOT)) || + if (((v->current_order.GetDepotActionType() & ODATFB_HALT) && v->current_order.IsType(OT_GOTO_DEPOT)) || (v->vehstatus & VS_STOPPED)) { /* we keep the vehicle in the depot since the user ordered it to stay */ + v->vehstatus |= VS_STOPPED; // needed for refitting v->leave_depot_instantly = false; } else { /* the vehicle do not plan on stopping in the depot, so we stop it to ensure that it will not reserve the path @@ -1623,7 +1624,8 @@ void VehicleEnterDepot(Vehicle *v) /* Part of orders */ UpdateVehicleTimetable(v, true); v->cur_order_index++; - } else if (t.GetDepotActionType() & ODATFB_HALT) { + } + if (t.GetDepotActionType() & ODATFB_HALT) { /* Force depot visit */ v->vehstatus |= VS_STOPPED; if (v->owner == _local_company) { -- cgit v1.2.3-54-g00ecf