summaryrefslogtreecommitdiff
path: root/roadveh_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
commitc6cd07e2e38f49af948f50398ee25b4ea4cef322 (patch)
treedcab8de4962e2d4d20e640fa781a69cd6480a973 /roadveh_cmd.c
parent567ad3b5db9a8372850d1e4b7ae77de932ef4c17 (diff)
downloadopenttd-c6cd07e2e38f49af948f50398ee25b4ea4cef322.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 'roadveh_cmd.c')
-rw-r--r--roadveh_cmd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index 6b39a5a11..f9acd3c44 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -1119,6 +1119,8 @@ static void RoadVehEventHandler(Vehicle *v)
if (RoadVehFindCloseTo(v,x,y,v->direction))
return;
+ VehicleServiceInDepot(v);
+
StartRoadVehSound(v);
BeginVehicleMove(v);
@@ -1377,13 +1379,12 @@ void RoadVehEnterDepot(Vehicle *v)
v->u.road.state = 254;
v->vehstatus |= VS_HIDDEN;
- v->date_of_last_service = _date;
- v->breakdowns_since_last_service = 0;
- v->reliability = _engines[v->engine_type].reliability;
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
MaybeRenewVehicle(v, EstimateRoadVehCost(v->engine_type));
+ VehicleServiceInDepot(v);
+
TriggerVehicle(v, VEHICLE_TRIGGER_DEPOT);
if (v->current_order.type == OT_GOTO_DEPOT) {