1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 01:49:10 +00:00

Fix: Engine age is in months, not days (#10773)

This commit is contained in:
Tyler Trahan
2023-05-06 11:54:38 -04:00
committed by GitHub
parent 31d1a323ef
commit 0fc21b5686
2 changed files with 4 additions and 4 deletions

View File

@@ -611,8 +611,8 @@ void CalcEngineReliability(Engine *e, bool new_month)
re = Engine::Get(re->info.variant_id);
}
uint age = re->age;
if (new_month && re->index > e->index && age != MAX_DAY) age++; /* parent variant's age has not yet updated. */
uint32 age = re->age;
if (new_month && re->index > e->index && age != INT32_MAX) age++; /* parent variant's age has not yet updated. */
/* Check for early retirement */
if (e->company_avail != 0 && !_settings_game.vehicle.never_expire_vehicles && e->info.base_life != 0xFF) {
@@ -1094,7 +1094,7 @@ void EnginesMonthlyLoop()
bool refresh = false;
for (Engine *e : Engine::Iterate()) {
/* Age the vehicle */
if ((e->flags & ENGINE_AVAILABLE) && e->age != MAX_DAY) {
if ((e->flags & ENGINE_AVAILABLE) && e->age != INT32_MAX) {
e->age++;
CalcEngineReliability(e, true);
refresh = true;