mirror of https://github.com/OpenTTD/OpenTTD
Codechange: CargoSpec::Iterate already tests cargo validity. (#13941)
parent
8d0ba5649a
commit
2ae84f3c9e
|
@ -2701,7 +2701,6 @@ static void ConDumpCargoTypes()
|
|||
|
||||
std::map<uint32_t, const GRFFile *> grfs;
|
||||
for (const CargoSpec *spec : CargoSpec::Iterate()) {
|
||||
if (!spec->IsValid()) continue;
|
||||
uint32_t grfid = 0;
|
||||
const GRFFile *grf = spec->grffile;
|
||||
if (grf != nullptr) {
|
||||
|
|
|
@ -2619,7 +2619,6 @@ struct IndustryCargoesWindow : public Window {
|
|||
this->cargo_textsize.width = 0;
|
||||
this->cargo_textsize.height = 0;
|
||||
for (const CargoSpec *csp : CargoSpec::Iterate()) {
|
||||
if (!csp->IsValid()) continue;
|
||||
this->cargo_textsize = maxdim(this->cargo_textsize, GetStringBoundingBox(csp->name));
|
||||
}
|
||||
d = maxdim(d, this->cargo_textsize); // Box must also be wide enough to hold any cargo label.
|
||||
|
|
|
@ -528,8 +528,6 @@ static void BuildCargoTranslationMap()
|
|||
auto cargo_list = GetCargoTranslationTable(*_cur.grffile);
|
||||
|
||||
for (const CargoSpec *cs : CargoSpec::Iterate()) {
|
||||
if (!cs->IsValid()) continue;
|
||||
|
||||
/* Check the translation table for this cargo's label */
|
||||
int idx = find_index(cargo_list, cs->label);
|
||||
if (idx >= 0) _cur.grffile->cargo_map[cs->Index()] = idx;
|
||||
|
|
Loading…
Reference in New Issue