diff options
author | tron <tron@openttd.org> | 2004-12-11 10:17:10 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2004-12-11 10:17:10 +0000 |
commit | 0ba5123cef72c427c010f9ce8bcb6003e1de72bd (patch) | |
tree | d480e20495e9f20ac7e66ff407aa48a08fcb4321 /vehicle.c | |
parent | 5a3ef18c94cabc855b956a2bbcd6a7ed91ea2b2e (diff) | |
download | openttd-0ba5123cef72c427c010f9ce8bcb6003e1de72bd.tar.xz |
(svn r1015) MFM r789
Replaced the slightly misleading SERVICE_INTERVAL by a function VehicleNeedsService()
Diffstat (limited to 'vehicle.c')
-rw-r--r-- | vehicle.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -22,6 +22,13 @@ void VehicleServiceInDepot(Vehicle *v) v->reliability = _engines[v->engine_type].reliability; } +bool VehicleNeedsService(const Vehicle *v) +{ + 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); +} + Order UnpackOldOrder(uint16 packed) { Order order; |