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.
(cherry picked from commit 30172fc037
)
This commit is contained in:

committed by
Jonathan G Rennison

parent
2890127675
commit
e5673a1756
@@ -1766,15 +1766,15 @@ struct StationViewWindow : public Window {
|
||||
const CargoPacket *cp = *it;
|
||||
StationID next = it.GetKey();
|
||||
|
||||
const CargoDataEntry *source_entry = source_dest->Retrieve(cp->SourceStation());
|
||||
const CargoDataEntry *source_entry = source_dest->Retrieve(cp->GetFirstStation());
|
||||
if (source_entry == nullptr) {
|
||||
this->ShowCargo(cargo, i, cp->SourceStation(), next, INVALID_STATION, cp->Count());
|
||||
this->ShowCargo(cargo, i, cp->GetFirstStation(), next, INVALID_STATION, cp->Count());
|
||||
continue;
|
||||
}
|
||||
|
||||
const CargoDataEntry *via_entry = source_entry->Retrieve(next);
|
||||
if (via_entry == nullptr) {
|
||||
this->ShowCargo(cargo, i, cp->SourceStation(), next, INVALID_STATION, cp->Count());
|
||||
this->ShowCargo(cargo, i, cp->GetFirstStation(), next, INVALID_STATION, cp->Count());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1795,7 +1795,7 @@ struct StationViewWindow : public Window {
|
||||
val = std::min<uint>(remaining, DivideApprox(cp->Count() * dest_entry->GetCount(), via_entry->GetCount()));
|
||||
remaining -= val;
|
||||
}
|
||||
this->ShowCargo(cargo, i, cp->SourceStation(), next, dest_entry->GetStation(), val);
|
||||
this->ShowCargo(cargo, i, cp->GetFirstStation(), next, dest_entry->GetStation(), val);
|
||||
}
|
||||
}
|
||||
this->ShowCargo(cargo, i, NEW_STATION, NEW_STATION, NEW_STATION, packets.ReservedCount());
|
||||
|
Reference in New Issue
Block a user