1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 17:32:45 +01:00

Codechange: Rename short CargoType parameters cargo. (#13848)

Rename CargoType variables and parameters using short or meaningless names.
This commit is contained in:
Peter Nelson
2025-03-24 18:18:21 +00:00
committed by GitHub
parent bdea29c414
commit b96b26ef15
15 changed files with 163 additions and 163 deletions

View File

@@ -99,20 +99,20 @@ Station::~Station()
if (a->targetairport == this->index) a->targetairport = StationID::Invalid();
}
for (CargoType c = 0; c < NUM_CARGO; ++c) {
LinkGraph *lg = LinkGraph::GetIfValid(this->goods[c].link_graph);
for (CargoType cargo = 0; cargo < NUM_CARGO; ++cargo) {
LinkGraph *lg = LinkGraph::GetIfValid(this->goods[cargo].link_graph);
if (lg == nullptr) continue;
for (NodeID node = 0; node < lg->Size(); ++node) {
Station *st = Station::Get((*lg)[node].station);
if (!st->goods[c].HasData()) continue;
st->goods[c].GetData().flows.erase(this->index);
if ((*lg)[node].HasEdgeTo(this->goods[c].node) && (*lg)[node][this->goods[c].node].LastUpdate() != EconomyTime::INVALID_DATE) {
st->goods[c].GetData().flows.DeleteFlows(this->index);
RerouteCargo(st, c, this->index, st->index);
if (!st->goods[cargo].HasData()) continue;
st->goods[cargo].GetData().flows.erase(this->index);
if ((*lg)[node].HasEdgeTo(this->goods[cargo].node) && (*lg)[node][this->goods[cargo].node].LastUpdate() != EconomyTime::INVALID_DATE) {
st->goods[cargo].GetData().flows.DeleteFlows(this->index);
RerouteCargo(st, cargo, this->index, st->index);
}
}
lg->RemoveNode(this->goods[c].node);
lg->RemoveNode(this->goods[cargo].node);
if (lg->Size() == 0) {
LinkGraphSchedule::instance.Unqueue(lg);
delete lg;