forked from mirror/OpenTTD
(svn r22984) -Feature: Display profit icons for groups in the group GUI.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user