@@ -1388,7 +1388,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 75
GetMaxSpeed(): 64
GetPrice(): 8203
GetMaxAge(): 5479
GetMaxAge(): 5490
GetRunningCost(): 820
GetPower(): 300
GetWeight(): 47
@@ -1532,7 +1532,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 80
GetMaxSpeed(): 112
GetPrice(): 15234
GetMaxAge(): 7671
GetMaxAge(): 7686
GetRunningCost(): 1968
GetPower(): 1000
GetWeight(): 131
@@ -1550,7 +1550,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 84
GetMaxSpeed(): 128
GetPrice(): 22265
GetMaxAge(): 7305
GetMaxAge(): 7320
GetRunningCost(): 2296
GetPower(): 1200
GetWeight(): 162
@@ -3476,7 +3476,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 78
GetMaxSpeed(): 56
GetPrice(): 4921
GetMaxAge(): 4383
GetMaxAge(): 4392
GetRunningCost(): 426
GetPower(): 90
GetWeight(): 10
@@ -3602,7 +3602,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 77
GetMaxSpeed(): 48
GetPrice(): 4429
GetRunningCost(): 421
GetPower(): 120
GetWeight(): 9
@@ -3656,7 +3656,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 92
GetPrice(): 4716
@@ -3764,7 +3764,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 98
GetPrice(): 4511
@@ -3818,7 +3818,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 97
GetPrice(): 4306
@@ -3872,7 +3872,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 87
GetPrice(): 4388
@@ -3926,7 +3926,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetPrice(): 4675
@@ -3980,7 +3980,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetPrice(): 4839
@@ -4034,7 +4034,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetPrice(): 4962
@@ -4088,7 +4088,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 82
GetPrice(): 4593
@@ -4142,7 +4142,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 76
GetPrice(): 5947
@@ -5060,7 +5060,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 99
GetMaxSpeed(): 24
GetPrice(): 30468
GetMaxAge(): 10958
GetMaxAge(): 10980
GetPower(): -1
GetWeight(): -1
@@ -5096,7 +5096,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 88
GetMaxSpeed(): 32
GetPrice(): 18281
GetRunningCost(): 1476
@@ -5186,7 +5186,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 81
GetPrice(): 24375
GetRunningCost(): 2460
@@ -5258,7 +5258,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 58
GetMaxSpeed(): 236
GetPrice(): 28710
GetRunningCost(): 2390
@@ -5276,7 +5276,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetReliability(): 95
GetPrice(): 30761
GetMaxAge(): 8766
GetMaxAge(): 8784
GetRunningCost(): 2812
@@ -5330,7 +5330,7 @@ ERROR: IsEnd() is invalid as Begin() is
GetRunningCost(): 2756
@@ -9323,8 +9323,8 @@ ERROR: IsEnd() is invalid as Begin() is
GetEngineType(): 153
GetUnitNumber(): 1
GetAge(): 1
GetAgeLeft(): 5478
GetAgeLeft(): 5489
GetCurrentSpeed(): 7
GetProfitThisYear(): -1
@@ -9416,17 +9416,17 @@ ERROR: IsEnd() is invalid as Begin() is
14 => 0
13 => 0
MaxAge ListDump:
16 => 10958
14 => 10958
17 => 7305
13 => 5479
12 => 5479
16 => 10980
14 => 10980
17 => 7320
13 => 5490
12 => 5490
AgeLeft ListDump:
12 => 5478
12 => 5489
CurrentSpeed ListDump:
12 => 27
17 => 0
@@ -438,7 +438,8 @@ uint Engine::GetDisplayMaxTractiveEffort
*/
TimerGameCalendar::Date Engine::GetLifeLengthInDays() const
{
return TimerGameCalendar::DateAtStartOfYear(this->info.lifelength + _settings_game.vehicle.extend_vehicle_life);
/* Assume leap years; this gives the player a bit more than the given amount of years, but never less. */
return static_cast<int32_t>(this->info.lifelength + _settings_game.vehicle.extend_vehicle_life) * CalendarTime::DAYS_IN_LEAP_YEAR;
}
/**
@@ -663,7 +664,7 @@ void SetYearEngineAgingStops()
/* Base year ending date on half the model life */
TimerGameCalendar::YearMonthDay ymd;
TimerGameCalendar::ConvertDateToYMD(ei->base_intro + static_cast<int32_t>(TimerGameCalendar::DateAtStartOfYear(ei->lifelength)) / 2, &ymd);
TimerGameCalendar::ConvertDateToYMD(ei->base_intro + (static_cast<int32_t>(ei->lifelength) * CalendarTime::DAYS_IN_LEAP_YEAR) / 2, &ymd);
_year_engine_aging_stops = std::max(_year_engine_aging_stops, ymd.year);
@@ -305,7 +305,7 @@ CommandCost CmdSetTimetableStart(DoComma
/* Don't let a timetable start more than 15 years into the future or 1 year in the past. */
if (start_date < 0 || start_date > CalendarTime::MAX_DATE) return CMD_ERROR;
if (start_date - TimerGameCalendar::date > TimerGameCalendar::DateAtStartOfYear(MAX_TIMETABLE_START_YEARS)) return CMD_ERROR;
if (start_date - TimerGameCalendar::date > static_cast<int32_t>(MAX_TIMETABLE_START_YEARS) * CalendarTime::DAYS_IN_LEAP_YEAR) return CMD_ERROR;
if (TimerGameCalendar::date - start_date > CalendarTime::DAYS_IN_LEAP_YEAR) return CMD_ERROR;
if (timetable_all && !v->orders->IsCompleteTimetable()) return CommandCost(STR_ERROR_TIMETABLE_INCOMPLETE);
if (timetable_all && start_date + total_duration / Ticks::DAY_TICKS > CalendarTime::MAX_DATE) return CMD_ERROR;
Status change: