Changeset - r20568:5ff63a8733fa
[Not reviewed]
master
0 1 0
rubidium - 11 years ago 2013-07-13 14:12:14
rubidium@openttd.org
(svn r25604) -Fix [FS#5550]: Only the front engine's date of last service was updated
1 file changed with 11 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/vehicle.cpp
Show inline comments
 
@@ -87,14 +87,24 @@ bool Vehicle::NeedsAutorenewing(const Co
 
	return true;
 
}
 

	
 
/**
 
 * Service a vehicle and all subsequent vehicles in the consist
 
 *
 
 * @param *v The vehicle or vehicle chain being serviced
 
 */
 
void VehicleServiceInDepot(Vehicle *v)
 
{
 
	assert(v != NULL);
 
	SetWindowDirty(WC_VEHICLE_DETAILS, v->index); // ensure that last service date and reliability are updated
 

	
 
	do {
 
	v->date_of_last_service = _date;
 
	v->breakdowns_since_last_service = 0;
 
	v->reliability = v->GetEngine()->reliability;
 
	/* Prevent vehicles from breaking down directly after exiting the depot. */
 
	v->breakdown_chance /= 4;
 
	SetWindowDirty(WC_VEHICLE_DETAILS, v->index); // ensure that last service date and reliability are updated
 
		v = v->Next();
 
	} while (v != NULL && v->HasEngineType());
 
}
 

	
 
/**
0 comments (0 inline, 0 general)