File diff r7543:fa81401cca0e → r7544:f5499742ca87
src/vehicle.cpp
Show inline comments
 
@@ -1467,38 +1467,34 @@ static const StringID _vehicle_type_name
 
};
 

	
 
static void ShowVehicleGettingOld(Vehicle *v, StringID msg)
 
{
 
	if (v->owner != _local_player) return;
 

	
 
	/* Do not show getting-old message if autorenew is active */
 
	if (GetPlayer(v->owner)->engine_renew) return;
 
	/* Do not show getting-old message if autorenew is active (and it can replace the vehicle) */
 
	if (GetPlayer(v->owner)->engine_renew && GetEngine(v->engine_type)->player_avail != 0) return;
 

	
 
	SetDParam(0, _vehicle_type_names[v->type]);
 
	SetDParam(1, v->unitnumber);
 
	AddNewsItem(msg, NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0), v->index, 0);
 
}
 

	
 
void AgeVehicle(Vehicle *v)
 
{
 
	int age;
 

	
 
	if (v->age < 65535)
 
		v->age++;
 

	
 
	age = v->age - v->max_age;
 
	if (age == 366*0 || age == 366*1 || age == 366*2 || age == 366*3 || age == 366*4)
 
		v->reliability_spd_dec <<= 1;
 
	if (v->age < 65535) v->age++;
 

	
 
	int age = v->age - v->max_age;
 
	if (age == 366*0 || age == 366*1 || age == 366*2 || age == 366*3 || age == 366*4) v->reliability_spd_dec <<= 1;
 

	
 
	InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
 

	
 
	if (age == -366) {
 
		ShowVehicleGettingOld(v, STR_01A0_IS_GETTING_OLD);
 
	} else if (age == 0) {
 
		ShowVehicleGettingOld(v, STR_01A1_IS_GETTING_VERY_OLD);
 
	} else if (age == 366*1 || age == 366*2 || age == 366*3 || age == 366*4 || age == 366*5) {
 
	} else if ((age % 366) == 0) {
 
		ShowVehicleGettingOld(v, STR_01A2_IS_GETTING_VERY_OLD_AND);
 
	}
 
}
 

	
 
/** Starts or stops a lot of vehicles
 
 * @param tile Tile of the depot where the vehicles are started/stopped (only used for depots)