Codechange: cleanup CargoPacket in terms of variable/function names (#11278)

Over the years, things got reused and changed, making the current
names somewhat unclear in what they actually mean and do.
This commit is contained in:
Patric Stout
2023-09-09 23:21:21 +02:00
committed by GitHub
parent b0e73277d6
commit 30172fc037
14 changed files with 106 additions and 99 deletions

View File

@@ -291,7 +291,7 @@ static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary *su
item->capacity += v->cargo_cap;
item->amount += v->cargo.StoredCount();
if (item->source == INVALID_STATION) item->source = v->cargo.Source();
if (item->source == INVALID_STATION) item->source = v->cargo.GetFirstStation();
} while ((v = v->Next()) != nullptr && v->IsArticulatedPart());
}
@@ -440,7 +440,7 @@ void DrawTrainDetails(const Train *v, const Rect &r, int vscroll_pos, uint16_t v
for (const Vehicle *u = v; u != nullptr; u = u->Next()) {
act_cargo[u->cargo_type] += u->cargo.StoredCount();
max_cargo[u->cargo_type] += u->cargo_cap;
feeder_share += u->cargo.FeederShare();
feeder_share += u->cargo.GetFeederShare();
}
/* draw total cargo tab */