Drop support for save game format 2

macos_ci_fix
Evil Eye 1 year ago
parent 521cff08f8
commit becc5ef8fa

@ -42,8 +42,6 @@ namespace ESM
{
esm.getHNOT(mDead, "DEAD");
esm.getHNOT(mDeathAnimationFinished, "DFNT");
if (esm.getFormatVersion() <= MaxOldDeathAnimationFormatVersion && mDead)
mDeathAnimationFinished = true;
esm.getHNOT(mDied, "DIED");
esm.getHNOT(mMurdered, "MURD");
esm.getHNOT(mTalkedTo, "TALK");

@ -9,7 +9,6 @@ namespace ESM
inline constexpr FormatVersion DefaultFormatVersion = 0;
inline constexpr FormatVersion CurrentContentFormatVersion = 1;
inline constexpr FormatVersion MaxOldDeathAnimationFormatVersion = 2;
inline constexpr FormatVersion MaxOldFogOfWarFormatVersion = 6;
inline constexpr FormatVersion MaxUnoptimizedCharacterDataFormatVersion = 7;
inline constexpr FormatVersion MaxOldTimeLeftFormatVersion = 8;
@ -27,7 +26,7 @@ namespace ESM
inline constexpr FormatVersion MaxActiveSpellSlotIndexFormatVersion = 27;
inline constexpr FormatVersion CurrentSaveGameFormatVersion = 29;
inline constexpr FormatVersion MinSupportedSaveGameFormatVersion = 2;
inline constexpr FormatVersion MinSupportedSaveGameFormatVersion = 3;
inline constexpr FormatVersion OpenMW0_48SaveGameFormatVersion = 21;
inline constexpr FormatVersion OpenMW0_49SaveGameFormatVersion = CurrentSaveGameFormatVersion;
}

@ -52,20 +52,17 @@ namespace ESM
mItems.push_back(state);
}
std::map<std::pair<ESM::RefId, std::string>, int32_t> levelledItemMap;
// Next item is Levelled item
while (esm.isNextSub("LEVM"))
{
// Get its name
ESM::RefId id = esm.getRefId();
int32_t count;
std::string parentGroup;
// Then get its count
esm.getHNT(count, "COUN");
// Old save formats don't have information about parent group; check for that
if (esm.isNextSub("LGRP"))
// Newest saves contain parent group
parentGroup = esm.getHString();
mLevelledItemMap[std::make_pair(id, parentGroup)] = count;
std::string parentGroup = esm.getHNString("LGRP");
levelledItemMap[std::make_pair(id, parentGroup)] = count;
}
while (esm.isNextSub("MAGI"))
@ -117,7 +114,7 @@ namespace ESM
// Old saves had restocking levelled items in a special map
// This turns items from that map into negative quantities
for (const auto& entry : mLevelledItemMap)
for (const auto& entry : levelledItemMap)
{
const ESM::RefId& id = entry.first.first;
const int count = entry.second;
@ -141,13 +138,6 @@ namespace ESM
}
}
for (auto it = mLevelledItemMap.begin(); it != mLevelledItemMap.end(); ++it)
{
esm.writeHNRefId("LEVM", it->first.first);
esm.writeHNT("COUN", it->second);
esm.writeHNString("LGRP", it->first.second);
}
for (const auto& [id, params] : mPermanentMagicEffectMagnitudes)
{
esm.writeHNRefId("MAGI", id);

@ -22,8 +22,6 @@ namespace ESM
// <Index in mItems, equipment slot>
std::map<uint32_t, int32_t> mEquipmentSlots;
std::map<std::pair<ESM::RefId, std::string>, int32_t> mLevelledItemMap;
std::map<ESM::RefId, std::vector<std::pair<float, float>>> mPermanentMagicEffectMagnitudes;
std::optional<uint32_t> mSelectedEnchantItem; // For inventories only

@ -42,9 +42,6 @@ namespace ESM
else
mPosition = mRef.mPos;
if (esm.isNextSub("LROT"))
esm.skipHSub(); // local rotation, no longer used
mFlags = 0;
esm.getHNOT(mFlags, "FLAG");

Loading…
Cancel
Save