summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-31 17:13:39 +0000
committerrubidium <rubidium@openttd.org>2007-08-31 17:13:39 +0000
commitcadc470da5eeffc9d719dfb0dab6216ed372a3ea (patch)
tree9b85848c6535d62d87e3afbd781847214c62b4e2 /src/train_cmd.cpp
parent313fc8930f827f0eeb130c985fe942f59f4fc72c (diff)
downloadopenttd-cadc470da5eeffc9d719dfb0dab6216ed372a3ea.tar.xz
(svn r11017) -Codechange: unify determining whether a vehicle needs/can be service a little more.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index caf665cf0..2981eec40 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3348,18 +3348,8 @@ void Train::Tick()
static void CheckIfTrainNeedsService(Vehicle *v)
{
- if (_patches.servint_trains == 0) return;
- if (!VehicleNeedsService(v)) return;
- if (v->vehstatus & VS_STOPPED) return;
- if (_patches.gotodepot && VehicleHasDepotOrders(v)) return;
-
- /* Don't interfere with a depot visit scheduled by the user, or a
- * depot visit by the order list. */
- if (v->current_order.type == OT_GOTO_DEPOT &&
- (v->current_order.flags & (OF_HALT_IN_DEPOT | OF_PART_OF_ORDERS)) != 0)
- return;
-
- if (CheckTrainIsInsideDepot(v)) {
+ if (_patches.servint_trains == 0 || !VehicleNeedsService(v)) return;
+ if (v->IsInDepot()) {
VehicleServiceInDepot(v);
return;
}
@@ -3386,8 +3376,6 @@ static void CheckIfTrainNeedsService(Vehicle *v)
return;
}
- if (v->current_order.type == OT_LOADING) v->LeaveStation();
-
v->current_order.type = OT_GOTO_DEPOT;
v->current_order.flags = OF_NON_STOP;
v->current_order.dest = depot->index;