summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-10-24 14:49:45 +0000
committerrubidium <rubidium@openttd.org>2008-10-24 14:49:45 +0000
commit4694b10706d149977632bf6bbb513bd2febb17bc (patch)
tree40582103b55598cf5fc668c1f58b05dee89d131d /src/vehicle.cpp
parent363c3be285b95fff99343a242130bc711edbb5d3 (diff)
downloadopenttd-4694b10706d149977632bf6bbb513bd2febb17bc.tar.xz
(svn r14524) -Add: stop-in-depot as part of orders (PhilSophus)
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp6
1 files changed, 4 insertions, 2 deletions
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) {