From 5ba666883bb7bc2d6f6b39f0e3733a328ec38243 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 2 Jan 2017 19:27:39 +0000 Subject: [PATCH] Fix double/inconsistent updating of variables when servicing vehicle. --- src/vehicle.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 4f0baa4052..d7b1445b0d 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -153,10 +153,6 @@ void VehicleServiceInDepot(Vehicle *v) CLRBITS(Train::From(v)->flags, (1 << VRF_BREAKDOWN_BRAKING) | VRF_IS_BROKEN ); } } - v->date_of_last_service = _date; - v->breakdowns_since_last_service = 0; - v->reliability = e->reliability; - v->breakdown_ctr = 0; v->vehstatus &= ~VS_AIRCRAFT_BROKEN; SetWindowDirty(WC_VEHICLE_DETAILS, v->index); // ensure that last service date and reliability are updated @@ -166,6 +162,7 @@ void VehicleServiceInDepot(Vehicle *v) v->reliability = v->GetEngine()->reliability; /* Prevent vehicles from breaking down directly after exiting the depot. */ v->breakdown_chance = 0; + v->breakdown_ctr = 0; v = v->Next(); } while (v != NULL && v->HasEngineType()); }