forked from mirror/OpenTTD
(svn r2261) - Fix: When crashed vehicles try to find a depot for servicing, openttd asserts.
Crashed vehicles shouldn't find depots anyway...
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user