summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-10-03 17:25:44 +0000
committerfrosch <frosch@openttd.org>2011-10-03 17:25:44 +0000
commit23a2f23eb35cec39f7a31fe6b541c95a11e0102f (patch)
tree0e25194fcb6683e3b9355a26d6fc85cd3c063a5a /src/vehicle.cpp
parentd6e6e8a9d4d4e6937fc030a7d5d5a0e38cf6f991 (diff)
downloadopenttd-23a2f23eb35cec39f7a31fe6b541c95a11e0102f.tar.xz
(svn r22984) -Feature: Display profit icons for groups in the group GUI.
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);
}