MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetLifeLengthInDays

Method GetLifeLengthInDays

src/engine.cpp:442–446  ·  view source on GitHub ↗

* Returns the vehicle's (not model's!) life length in days. * @return the life length */

Source from the content-addressed store, hash-verified

440 * @return the life length
441 */
442TimerGameCalendar::Date Engine::GetLifeLengthInDays() const
443{
444 /* Assume leap years; this gives the player a bit more than the given amount of years, but never less. */
445 return TimerGameCalendar::Date{(this->info.lifelength + _settings_game.vehicle.extend_vehicle_life).base() * CalendarTime::DAYS_IN_LEAP_YEAR};
446}
447
448/**
449 * Get the range of an aircraft type.

Callers 6

CmdBuildShipFunction · 0.80
CmdBuildRailVehicleFunction · 0.80
CmdBuildRoadVehicleFunction · 0.80
CmdBuildAircraftFunction · 0.80
DrawVehiclePurchaseInfoFunction · 0.80
GetMaxAgeMethod · 0.80

Calls 1

baseMethod · 0.45

Tested by

no test coverage detected