mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 15:41:15 +00:00
`CargoSpec::Iterate()` deliberately skips invalid cargo types, but `FinaliseCargoCarry()` is only interested in them.
This commit is contained in:
parent
db7697bcdf
commit
903119115b
@ -175,6 +175,7 @@ private:
|
||||
static CargoSpec array[NUM_CARGO]; ///< Array holding all CargoSpecs
|
||||
|
||||
friend void SetupCargoForClimate(LandscapeID l);
|
||||
friend void FinaliseCargoArray();
|
||||
};
|
||||
|
||||
extern CargoTypes _cargo_mask;
|
||||
|
@ -9174,13 +9174,13 @@ static void FinaliseEngineArray()
|
||||
}
|
||||
|
||||
/** Check for invalid cargoes */
|
||||
static void FinaliseCargoArray()
|
||||
void FinaliseCargoArray()
|
||||
{
|
||||
for (CargoSpec *cs : CargoSpec::Iterate()) {
|
||||
if (!cs->IsValid()) {
|
||||
cs->name = cs->name_single = cs->units_volume = STR_NEWGRF_INVALID_CARGO;
|
||||
cs->quantifier = STR_NEWGRF_INVALID_CARGO_QUANTITY;
|
||||
cs->abbrev = STR_NEWGRF_INVALID_CARGO_ABBREV;
|
||||
for (CargoSpec &cs : CargoSpec::array) {
|
||||
if (!cs.IsValid()) {
|
||||
cs.name = cs.name_single = cs.units_volume = STR_NEWGRF_INVALID_CARGO;
|
||||
cs.quantifier = STR_NEWGRF_INVALID_CARGO_QUANTITY;
|
||||
cs.abbrev = STR_NEWGRF_INVALID_CARGO_ABBREV;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user