diff --git a/CHANGELOG.md b/CHANGELOG.md index 83baf27872..8f986e8dea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -133,7 +133,6 @@ Feature #6447: Add LOD support to Object Paging Feature #6491: Add support for Qt6 Feature #6556: Lua API for sounds - Feature #6624: Drop support for old saves Feature #6726: Lua API for creating new objects Feature #6864: Lua file access API Feature #6922: Improve launcher appearance @@ -165,6 +164,7 @@ Feature #7698: Implement sAbsorb, sDamage, sDrain, sFortify and sRestore Feature #7709: Improve resolution selection in Launcher Task #5896: Do not use deprecated MyGUI properties + Task #6624: Drop support for saves made prior to 0.45 Task #7113: Move from std::atoi to std::from_char Task #7117: Replace boost::scoped_array with std::vector Task #7151: Do not use std::strerror to get errno error message diff --git a/components/esm3/aisequence.cpp b/components/esm3/aisequence.cpp index bbd42c400e..99c85db1bb 100644 --- a/components/esm3/aisequence.cpp +++ b/components/esm3/aisequence.cpp @@ -29,7 +29,7 @@ namespace ESM void AiTravel::load(ESMReader& esm) { esm.getHNT("DATA", mData.mX, mData.mY, mData.mZ); - esm.getHNOT(mHidden, "HIDD"); + esm.getHNT(mHidden, "HIDD"); mRepeat = false; esm.getHNOT(mRepeat, "REPT"); } @@ -258,7 +258,7 @@ namespace ESM } } - esm.getHNOT(mLastAiPackage, "LAST"); + esm.getHNT(mLastAiPackage, "LAST"); if (count > 1 && esm.getFormatVersion() <= MaxOldAiPackageFormatVersion) { diff --git a/components/esm3/formatversion.hpp b/components/esm3/formatversion.hpp index 1489926fbd..9f499a7231 100644 --- a/components/esm3/formatversion.hpp +++ b/components/esm3/formatversion.hpp @@ -27,7 +27,7 @@ namespace ESM inline constexpr FormatVersion MaxOldCountFormatVersion = 30; inline constexpr FormatVersion CurrentSaveGameFormatVersion = 31; - inline constexpr FormatVersion MinSupportedSaveGameFormatVersion = 4; + inline constexpr FormatVersion MinSupportedSaveGameFormatVersion = 5; inline constexpr FormatVersion OpenMW0_48SaveGameFormatVersion = 21; inline constexpr FormatVersion OpenMW0_49SaveGameFormatVersion = CurrentSaveGameFormatVersion; } diff --git a/components/esm3/player.cpp b/components/esm3/player.cpp index aa6b59abb9..fd280bf12e 100644 --- a/components/esm3/player.cpp +++ b/components/esm3/player.cpp @@ -30,16 +30,12 @@ namespace ESM mPaidCrimeId = -1; esm.getHNOT(mPaidCrimeId, "PAYD"); - bool checkPrevItems = true; - while (checkPrevItems) + while (esm.peekNextSub("BOUN")) { - ESM::RefId boundItemId = esm.getHNORefId("BOUN"); - ESM::RefId prevItemId = esm.getHNORefId("PREV"); + ESM::RefId boundItemId = esm.getHNRefId("BOUN"); + ESM::RefId prevItemId = esm.getHNRefId("PREV"); - if (!boundItemId.empty()) - mPreviousItems[boundItemId] = prevItemId; - else - checkPrevItems = false; + mPreviousItems[boundItemId] = prevItemId; } if (esm.getFormatVersion() <= MaxOldSkillsAndAttributesFormatVersion) @@ -103,10 +99,10 @@ namespace ESM esm.writeHNT("CURD", mCurrentCrimeId); esm.writeHNT("PAYD", mPaidCrimeId); - for (PreviousItems::const_iterator it = mPreviousItems.begin(); it != mPreviousItems.end(); ++it) + for (const auto& [bound, prev] : mPreviousItems) { - esm.writeHNRefId("BOUN", it->first); - esm.writeHNRefId("PREV", it->second); + esm.writeHNRefId("BOUN", bound); + esm.writeHNRefId("PREV", prev); } esm.writeHNT("WWAT", mSaveAttributes); diff --git a/components/esm3/player.hpp b/components/esm3/player.hpp index 7f9309765c..0f76a3b5eb 100644 --- a/components/esm3/player.hpp +++ b/components/esm3/player.hpp @@ -33,8 +33,7 @@ namespace ESM float mSaveAttributes[Attribute::Length]; float mSaveSkills[Skill::Length]; - typedef std::map PreviousItems; // previous equipped items, needed for bound spells - PreviousItems mPreviousItems; + std::map mPreviousItems; // previous equipped items, needed for bound spells void load(ESMReader& esm); void save(ESMWriter& esm) const;