@@ -172,12 +172,13 @@ struct CargoSpec {
static IterateWrapper Iterate(size_t from = 0) { return IterateWrapper(from); }
private:
static CargoSpec array[NUM_CARGO]; ///< Array holding all CargoSpecs
friend void SetupCargoForClimate(LandscapeID l);
friend void FinaliseCargoArray();
};
extern CargoTypes _cargo_mask;
extern CargoTypes _standard_cargo_mask;
void SetupCargoForClimate(LandscapeID l);
@@ -9171,19 +9171,19 @@ static void FinaliseEngineArray()
Engine::Get(e->info.variant_id)->display_flags |= EngineDisplayFlags::HasVariants | EngineDisplayFlags::IsFolded;
}
/** Check for invalid cargoes */
static 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;
void FinaliseCargoArray()
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;
/**
* Check if a given housespec is valid and disable it if it's not.
Status change: