diff --git a/components/esm3/loadland.cpp b/components/esm3/loadland.cpp index 797cf2bc37..92808b5e00 100644 --- a/components/esm3/loadland.cpp +++ b/components/esm3/loadland.cpp @@ -94,7 +94,7 @@ namespace ESM mDataTypes |= DATA_VHGT; break; case fourCC("WNAM"): - esm.getHExact(mWnam, sizeof(mWnam)); + esm.getHExact(mWnam.data(), mWnam.size()); mDataTypes |= DATA_WNAM; break; case fourCC("VCLR"): @@ -325,9 +325,9 @@ namespace ESM , mY(land.mY) , mContext(land.mContext) , mDataTypes(land.mDataTypes) + , mWnam(land.mWnam) , mLandData(land.mLandData != nullptr ? std::make_unique(*land.mLandData) : nullptr) { - std::copy(land.mWnam, land.mWnam + LAND_GLOBAL_MAP_LOD_SIZE, mWnam); } Land& Land::operator=(const Land& land) diff --git a/components/esm3/loadland.hpp b/components/esm3/loadland.hpp index 0c7226324c..f5f4ef7a0f 100644 --- a/components/esm3/loadland.hpp +++ b/components/esm3/loadland.hpp @@ -1,6 +1,7 @@ #ifndef OPENMW_ESM_LAND_H #define OPENMW_ESM_LAND_H +#include #include #include @@ -125,7 +126,7 @@ namespace ESM }; // low-LOD heightmap (used for rendering the global map) - std::int8_t mWnam[LAND_GLOBAL_MAP_LOD_SIZE]; + std::array mWnam; void load(ESMReader& esm, bool& isDeleted); void save(ESMWriter& esm, bool isDeleted = false) const;