From 224acb78b03defd075aafec9d3340b3bc0dcedfc Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Sat, 27 Jun 2020 08:29:40 +0100 Subject: Fix: Compiler warnings about memsetting non-trivial classes --- src/cargotype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cargotype.cpp') diff --git a/src/cargotype.cpp b/src/cargotype.cpp index 52dd196c8..8421c482e 100644 --- a/src/cargotype.cpp +++ b/src/cargotype.cpp @@ -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 */ -- cgit v1.2.3-54-g00ecf