Fix #12010: Use economy timer for vehicle stats minimum age, not calendar (#12142)

This commit is contained in:
Tyler Trahan
2024-03-09 09:38:52 -05:00
committed by GitHub
parent 04ce1c08ae
commit 32b0fb9f6e
13 changed files with 42 additions and 15 deletions

View File

@@ -53,12 +53,12 @@ struct GUIVehicleGroup {
});
}
TimerGameCalendar::Date GetOldestVehicleAge() const
TimerGameEconomy::Date GetOldestVehicleAge() const
{
const Vehicle *oldest = *std::max_element(this->vehicles_begin, this->vehicles_end, [](const Vehicle *v_a, const Vehicle *v_b) {
return v_a->age < v_b->age;
return v_a->economy_age < v_b->economy_age;
});
return oldest->age;
return oldest->economy_age;
}
};