summaryrefslogtreecommitdiff
path: root/ship_cmd.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2004-12-09 21:46:56 +0000
committerbjarni <bjarni@openttd.org>2004-12-09 21:46:56 +0000
commit02bf3ed5c07451ae860bf4a197fca00908eb4293 (patch)
treedcab8de4962e2d4d20e640fa781a69cd6480a973 /ship_cmd.c
parent93a4dbda4b10d8b26c575e4b16d4505ea881dae5 (diff)
downloadopenttd-02bf3ed5c07451ae860bf4a197fca00908eb4293.tar.xz
(svn r998) now vehicles are serviced both when entering and when leaving depots to prevent that vehicles might need service when leaving after a long stay (ln--)
Diffstat (limited to 'ship_cmd.c')
-rw-r--r--ship_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ship_cmd.c b/ship_cmd.c
index 7894eed6b..578fce38a 100644
--- a/ship_cmd.c
+++ b/ship_cmd.c
@@ -352,6 +352,7 @@ static void CheckShipLeaveDepot(Vehicle *v)
RecalcShipStuff(v);
PlayShipSound(v);
+ VehicleServiceInDepot(v);
}
static bool ShipAccelerate(Vehicle *v)
@@ -394,9 +395,8 @@ static void ShipEnterDepot(Vehicle *v)
v->cur_speed = 0;
RecalcShipStuff(v);
- v->date_of_last_service = _date;
- v->breakdowns_since_last_service = 0;
- v->reliability = _engines[v->engine_type].reliability;
+ VehicleServiceInDepot(v);
+
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
MaybeRenewVehicle(v, EstimateShipCost(v->engine_type));