Fix 3c047b1
: AIGroup.GetProfitLastYear could get values different than those displayed in GUI (#10227)
* Change: Store "all time" and "since minimum age" last year profits on groups * Fix: Update last year profit for groups when copying vehicle statistics on autoreplace * Codechange: Refactor profit last year * Change: Rename some group related items for clarity * Change: Reorder the fields in GroupStatistics That way less memory gets wasted.
This commit is contained in:
@@ -1379,7 +1379,7 @@ void AgeVehicle(Vehicle *v)
|
||||
{
|
||||
if (v->age < MAX_DAY) {
|
||||
v->age++;
|
||||
if (v->IsPrimaryVehicle() && v->age == VEHICLE_PROFIT_MIN_AGE + 1) GroupStatistics::VehicleReachedProfitAge(v);
|
||||
if (v->IsPrimaryVehicle() && v->age == VEHICLE_PROFIT_MIN_AGE + 1) GroupStatistics::VehicleReachedMinAge(v);
|
||||
}
|
||||
|
||||
if (!v->IsPrimaryVehicle() && (v->type != VEH_TRAIN || !Train::From(v)->IsEngine())) return;
|
||||
|
Reference in New Issue
Block a user