diff --git a/components/esm3/formatversion.hpp b/components/esm3/formatversion.hpp index 9f499a7231..d90742a512 100644 --- a/components/esm3/formatversion.hpp +++ b/components/esm3/formatversion.hpp @@ -9,6 +9,7 @@ namespace ESM inline constexpr FormatVersion DefaultFormatVersion = 0; inline constexpr FormatVersion CurrentContentFormatVersion = 1; + inline constexpr FormatVersion MaxOldGoldValueFormatVersion = 5; inline constexpr FormatVersion MaxOldFogOfWarFormatVersion = 6; inline constexpr FormatVersion MaxUnoptimizedCharacterDataFormatVersion = 7; inline constexpr FormatVersion MaxOldTimeLeftFormatVersion = 8; diff --git a/components/esm3/objectstate.cpp b/components/esm3/objectstate.cpp index 25cbdc9a98..f8905cfaea 100644 --- a/components/esm3/objectstate.cpp +++ b/components/esm3/objectstate.cpp @@ -30,7 +30,11 @@ namespace ESM esm.getHNOT(mEnabled, "ENAB"); if (mVersion <= MaxOldCountFormatVersion) - esm.getHNOT(mRef.mCount, "COUN"); + { + if (mVersion <= MaxOldGoldValueFormatVersion) + mRef.mCount = std::max(1, mRef.mCount); + esm.getHNOT("COUN", mRef.mCount); + } mPosition = mRef.mPos; esm.getHNOT("POS_", mPosition.pos, mPosition.rot);