Fix: Compiler warnings about memsetting non-trivial classes

This commit is contained in:
Charles Pigott
2020-06-27 08:29:40 +01:00
parent 8a655c7fb6
commit 224acb78b0
2 changed files with 2 additions and 2 deletions

View File

@@ -42,8 +42,8 @@ void SetupCargoForClimate(LandscapeID l)
assert(l < lengthof(_default_climate_cargo));
/* Reset and disable all cargo types */
memset(CargoSpec::array, 0, sizeof(CargoSpec::array));
for (CargoID i = 0; i < lengthof(CargoSpec::array); i++) {
*CargoSpec::Get(i) = {};
CargoSpec::Get(i)->bitnum = INVALID_CARGO;
/* Set defaults for newer properties, which old GRFs do not know */