1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-19 08:09:44 +00:00

Account for pre-0.46 saves storing a gold value of 0 for everything

This commit is contained in:
Evil Eye 2024-02-22 20:23:21 +01:00
parent e4a9e83609
commit 0bab37327c
2 changed files with 6 additions and 1 deletions

View file

@ -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;

View file

@ -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);