Codechange: Simplify initialization of default cargoes.

This commit is contained in:
Peter Nelson
2023-04-27 13:26:10 +01:00
committed by PeterN
parent c6864637fb
commit e8cbc3c2c7
2 changed files with 3 additions and 9 deletions

View File

@@ -42,13 +42,7 @@ void SetupCargoForClimate(LandscapeID l)
assert(l < lengthof(_default_climate_cargo));
/* Reset and disable all cargo types */
for (CargoID i = 0; i < lengthof(CargoSpec::array); i++) {
*CargoSpec::Get(i) = {};
CargoSpec::Get(i)->bitnum = INVALID_CARGO_BITNUM;
/* Set defaults for newer properties, which old GRFs do not know */
CargoSpec::Get(i)->multiplier = 0x100;
}
std::fill(std::begin(CargoSpec::array), std::end(CargoSpec::array), CargoSpec{});
_cargo_mask = 0;