diff options
author | rubidium <rubidium@openttd.org> | 2007-08-31 17:13:39 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-08-31 17:13:39 +0000 |
commit | 2c8e50f20c84f65b19bc1d983e2715f827ee19d8 (patch) | |
tree | 9b85848c6535d62d87e3afbd781847214c62b4e2 /src/vehicle.cpp | |
parent | 976ce8ad3f16f2e1f38672eae3eeb6700a920f72 (diff) | |
download | openttd-2c8e50f20c84f65b19bc1d983e2715f827ee19d8.tar.xz |
(svn r11017) -Codechange: unify determining whether a vehicle needs/can be service a little more.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 2e37d1c15..003f21b47 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -91,8 +91,10 @@ void VehicleServiceInDepot(Vehicle *v) bool VehicleNeedsService(const Vehicle *v) { - if (v->vehstatus & VS_CRASHED) - return false; // Crashed vehicles don't need service anymore + if (v->vehstatus & (VS_STOPPED | VS_CRASHED)) return false; + if (_patches.gotodepot && VehicleHasDepotOrders(v)) return false; + if (v->current_order.type == OT_LOADING) return false; + if (v->current_order.type == OT_GOTO_DEPOT && v->current_order.flags & OF_HALT_IN_DEPOT) return false; if (_patches.no_servicing_if_no_breakdowns && _opt.diff.vehicle_breakdowns == 0) { return EngineHasReplacementForPlayer(GetPlayer(v->owner), v->engine_type, v->group_id); /* Vehicles set for autoreplacing needs to go to a depot even if breakdowns are turned off */ |