summaryrefslogtreecommitdiff
path: root/src/cargotype.cpp
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2020-06-27 08:29:40 +0100
committerCharles Pigott <charlespigott@googlemail.com>2020-06-27 14:51:14 +0100
commit224acb78b03defd075aafec9d3340b3bc0dcedfc (patch)
tree96d9fd595086226541b8e38b18a414a25dd9b648 /src/cargotype.cpp
parent8a655c7fb6375ad47b951b5011657dfa31cc76a6 (diff)
downloadopenttd-224acb78b03defd075aafec9d3340b3bc0dcedfc.tar.xz
Fix: Compiler warnings about memsetting non-trivial classes
Diffstat (limited to 'src/cargotype.cpp')
-rw-r--r--src/cargotype.cpp2
1 files changed, 1 insertions, 1 deletions
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 */