Merge branch 'oldsavessuck' into 'master'

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

See merge request OpenMW/openmw!3902
fix-osga-rotate-wildly
Alexei Kotov 10 months ago
commit 357b190571

@ -9,6 +9,7 @@ namespace ESM
inline constexpr FormatVersion DefaultFormatVersion = 0; inline constexpr FormatVersion DefaultFormatVersion = 0;
inline constexpr FormatVersion CurrentContentFormatVersion = 1; inline constexpr FormatVersion CurrentContentFormatVersion = 1;
inline constexpr FormatVersion MaxOldGoldValueFormatVersion = 5;
inline constexpr FormatVersion MaxOldFogOfWarFormatVersion = 6; inline constexpr FormatVersion MaxOldFogOfWarFormatVersion = 6;
inline constexpr FormatVersion MaxUnoptimizedCharacterDataFormatVersion = 7; inline constexpr FormatVersion MaxUnoptimizedCharacterDataFormatVersion = 7;
inline constexpr FormatVersion MaxOldTimeLeftFormatVersion = 8; inline constexpr FormatVersion MaxOldTimeLeftFormatVersion = 8;

@ -30,7 +30,11 @@ namespace ESM
esm.getHNOT(mEnabled, "ENAB"); esm.getHNOT(mEnabled, "ENAB");
if (mVersion <= MaxOldCountFormatVersion) 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; mPosition = mRef.mPos;
esm.getHNOT("POS_", mPosition.pos, mPosition.rot); esm.getHNOT("POS_", mPosition.pos, mPosition.rot);

Loading…
Cancel
Save