|
@@ -435,13 +435,13 @@ uint Engine::GetDisplayMaxTractiveEffort
|
|
|
/**
|
|
|
* Returns the vehicle's (not model's!) life length in days.
|
|
|
* @return the life length
|
|
|
*/
|
|
|
TimerGameCalendar::Date Engine::GetLifeLengthInDays() const
|
|
|
{
|
|
|
return DateAtStartOfYear(this->info.lifelength + _settings_game.vehicle.extend_vehicle_life);
|
|
|
return TimerGameCalendar::DateAtStartOfYear(this->info.lifelength + _settings_game.vehicle.extend_vehicle_life);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Get the range of an aircraft type.
|
|
|
* @return Range of the aircraft type in tiles or 0 if unlimited range.
|
|
|
*/
|
|
@@ -660,13 +660,13 @@ void SetYearEngineAgingStops()
|
|
|
/* Exclude certain engines */
|
|
|
if (!HasBit(ei->climates, _settings_game.game_creation.landscape)) continue;
|
|
|
if (e->type == VEH_TRAIN && e->u.rail.railveh_type == RAILVEH_WAGON) continue;
|
|
|
|
|
|
/* Base year ending date on half the model life */
|
|
|
TimerGameCalendar::YearMonthDay ymd;
|
|
|
TimerGameCalendar::ConvertDateToYMD(ei->base_intro + static_cast<int32_t>(DateAtStartOfYear(ei->lifelength)) / 2, &ymd);
|
|
|
TimerGameCalendar::ConvertDateToYMD(ei->base_intro + static_cast<int32_t>(TimerGameCalendar::DateAtStartOfYear(ei->lifelength)) / 2, &ymd);
|
|
|
|
|
|
_year_engine_aging_stops = std::max(_year_engine_aging_stops, ymd.year);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1100,13 +1100,13 @@ void EnginesMonthlyLoop()
|
|
|
refresh = true;
|
|
|
}
|
|
|
|
|
|
/* Do not introduce invalid engines */
|
|
|
if (!e->IsEnabled()) continue;
|
|
|
|
|
|
if (!(e->flags & ENGINE_AVAILABLE) && TimerGameCalendar::date >= (e->intro_date + DAYS_IN_YEAR)) {
|
|
|
if (!(e->flags & ENGINE_AVAILABLE) && TimerGameCalendar::date >= (e->intro_date + CalendarTime::DAYS_IN_YEAR)) {
|
|
|
/* Introduce it to all companies */
|
|
|
NewVehicleAvailable(e);
|
|
|
} else if (!(e->flags & (ENGINE_AVAILABLE | ENGINE_EXCLUSIVE_PREVIEW)) && TimerGameCalendar::date >= e->intro_date) {
|
|
|
/* Introduction date has passed...
|
|
|
* Check if it is allowed to build this vehicle type at all
|
|
|
* based on the current game settings. If not, it does not
|