summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 890e5e221..dce61e239 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -1137,7 +1137,10 @@ bool Vehicle::HandleBreakdown()
*/
void AgeVehicle(Vehicle *v)
{
- if (v->age < MAX_DAY) v->age++;
+ if (v->age < MAX_DAY) {
+ v->age++;
+ if (v->IsPrimaryVehicle() && v->age == VEHICLE_PROFIT_MIN_AGE + 1) GroupStatistics::VehicleReachedProfitAge(v);
+ }
if (!v->IsPrimaryVehicle() && (v->type != VEH_TRAIN || !Train::From(v)->IsEngine())) return;
@@ -2402,6 +2405,11 @@ void VehiclesYearlyLoop()
SetWindowDirty(WC_VEHICLE_DETAILS, v->index);
}
}
+ GroupStatistics::UpdateProfits();
+ SetWindowClassesDirty(WC_TRAINS_LIST);
+ SetWindowClassesDirty(WC_SHIPS_LIST);
+ SetWindowClassesDirty(WC_ROADVEH_LIST);
+ SetWindowClassesDirty(WC_AIRCRAFT_LIST);
}