summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/vehicle.c b/vehicle.c
index 9dcdc29be..b61805dc9 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -98,12 +98,16 @@ void VehicleServiceInDepot(Vehicle *v)
bool VehicleNeedsService(const Vehicle *v)
{
- if (_patches.no_servicing_if_no_breakdowns && _opt.diff.vehicle_breakdowns == 0)
- return false;
-
if (v->vehstatus & VS_CRASHED)
return false; /* Crashed vehicles don't need service anymore */
+ if (_patches.no_servicing_if_no_breakdowns && _opt.diff.vehicle_breakdowns == 0) {
+ if (EngineReplacementForPlayer(GetPlayer(v->owner), v->engine_type) != INVALID_ENGINE)
+ return true; /* Vehicles set for autoreplacing needs to go to a depot even if breakdowns are turned off */
+ else
+ return false;
+ }
+
return _patches.servint_ispercent ?
(v->reliability < GetEngine(v->engine_type)->reliability * (100 - v->service_interval) / 100) :
(v->date_of_last_service + v->service_interval < _date);