summaryrefslogtreecommitdiff
path: root/src/aircraft_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
commit2c8e50f20c84f65b19bc1d983e2715f827ee19d8 (patch)
tree9b85848c6535d62d87e3afbd781847214c62b4e2 /src/aircraft_cmd.cpp
parent976ce8ad3f16f2e1f38672eae3eeb6700a920f72 (diff)
downloadopenttd-2c8e50f20c84f65b19bc1d983e2715f827ee19d8.tar.xz
(svn r11017) -Codechange: unify determining whether a vehicle needs/can be service a little more.
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r--src/aircraft_cmd.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 4f6098d79..db22fbd0a 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -696,17 +696,8 @@ CommandCost CmdRefitAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
static void CheckIfAircraftNeedsService(Vehicle *v)
{
- if (_patches.servint_aircraft == 0) return;
- if (!VehicleNeedsService(v)) return;
- if (v->vehstatus & VS_STOPPED) return;
-
- if (v->current_order.type == OT_GOTO_DEPOT &&
- v->current_order.flags & OF_HALT_IN_DEPOT)
- return;
-
- if (_patches.gotodepot && VehicleHasDepotOrders(v)) return;
-
- if (v->IsInDepot()) {
+ if (_patches.servint_aircraft == 0 || !VehicleNeedsService(v)) return;
+ if (v->IsInDepot()) {
VehicleServiceInDepot(v);
return;
}
@@ -716,7 +707,6 @@ static void CheckIfAircraftNeedsService(Vehicle *v)
if (st->IsValid() && st->airport_tile != 0 && st->Airport()->terminals != NULL) {
// printf("targetairport = %d, st->index = %d\n", v->u.air.targetairport, st->index);
// v->u.air.targetairport = st->index;
- if (v->current_order.type == OT_LOADING) v->LeaveStation();
v->current_order.type = OT_GOTO_DEPOT;
v->current_order.flags = OF_NON_STOP;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);