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

@@ -215,7 +215,7 @@ int UpdateCompanyRatingAndValue(Company *c, bool update)
if (v->owner != owner) continue;
if (IsCompanyBuildableVehicleType(v->type) && v->IsPrimaryVehicle()) {
if (v->profit_last_year > 0) num++; // For the vehicle score only count profitable vehicles
if (v->age > 730) {
if (v->economy_age > VEHICLE_PROFIT_MIN_AGE) {
/* Find the vehicle with the lowest amount of profit */
if (min_profit_first || min_profit > v->profit_last_year) {
min_profit = v->profit_last_year;