summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authormatthijs <matthijs@openttd.org>2005-05-03 19:31:33 +0000
committermatthijs <matthijs@openttd.org>2005-05-03 19:31:33 +0000
commit24943a4759d290b2b01cc5d2607f6317b7ccfcb9 (patch)
tree717aa7afe0491338a1a0f2486f2f9242d228fb3f /vehicle.c
parent9b8aa4c10114f851815b703083ff9dc2d27f3675 (diff)
downloadopenttd-24943a4759d290b2b01cc5d2607f6317b7ccfcb9.tar.xz
(svn r2261) - Fix: When crashed vehicles try to find a depot for servicing, openttd asserts.
Crashed vehicles shouldn't find depots anyway...
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vehicle.c b/vehicle.c
index 03da2fdbe..4cd4b7b3a 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -55,6 +55,9 @@ 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 */
+
return _patches.servint_ispercent ?
(v->reliability < _engines[v->engine_type].reliability * (100 - v->service_interval) / 100) :
(v->date_of_last_service + v->service_interval < _date);