Fix: Calculation of initial engine age was inaccurate. (#11660)

Engine age in months was calculated as the difference in days / 32, instead of the actually difference in months. This would result in engines being artificially younger if a game was started at a later date.
This commit is contained in:
Peter Nelson
2023-12-31 15:47:32 +00:00
committed by GitHub
parent 7124b4eef1
commit 934545a674
3 changed files with 11 additions and 5 deletions

View File

@@ -27,7 +27,7 @@ bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company);
bool IsEngineRefittable(EngineID engine);
void SetYearEngineAgingStops();
void CalcEngineReliability(Engine *e, bool new_month);
void StartupOneEngine(Engine *e, TimerGameCalendar::Date aging_date, uint32_t seed);
void StartupOneEngine(Engine *e, const TimerGameCalendar::YearMonthDay &aging_ymd, uint32_t seed);
uint GetTotalCapacityOfArticulatedParts(EngineID engine);