forked from mirror/OpenTTD
(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--)
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user