mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 11:11:33 +00:00
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
This commit is contained in:
commit
357b190571
2 changed files with 6 additions and 1 deletions
|
@ -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…
Reference in a new issue