mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-21 09:09:43 +00:00
ESSImport: fix non-existing items in player record causing load failure in OpenMW
This commit is contained in:
parent
0fd5575efe
commit
98402e579d
1 changed files with 12 additions and 0 deletions
|
@ -111,6 +111,14 @@ public:
|
||||||
// need to fix openmw to account for this
|
// need to fix openmw to account for this
|
||||||
for (std::vector<std::string>::const_iterator it = npc.mSpells.mList.begin(); it != npc.mSpells.mList.end(); ++it)
|
for (std::vector<std::string>::const_iterator it = npc.mSpells.mList.begin(); it != npc.mSpells.mList.end(); ++it)
|
||||||
mContext->mPlayer.mObject.mCreatureStats.mSpells.mSpells[*it] = empty;
|
mContext->mPlayer.mObject.mCreatureStats.mSpells.mSpells[*it] = empty;
|
||||||
|
|
||||||
|
// Clear the list now that we've written it, this prevents issues cropping up with
|
||||||
|
// ensureCustomData() in OpenMW tripping over no longer existing spells, where an error would be fatal.
|
||||||
|
mContext->mPlayerBase.mSpells.mList.clear();
|
||||||
|
|
||||||
|
// Same with inventory. Actually it's strange this would contain something, since there's already an
|
||||||
|
// inventory list in NPCC. There seems to be a fair amount of redundancy in this format.
|
||||||
|
mContext->mPlayerBase.mInventory.mList.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -127,6 +135,10 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Do we need ConvertCONT?
|
||||||
|
// I've seen a CONT record in a certain save file, but the container contents in it
|
||||||
|
// were identical to a corresponding CNTC record. See previous comment about redundancy...
|
||||||
|
|
||||||
class ConvertGlobal : public DefaultConverter<ESM::Global>
|
class ConvertGlobal : public DefaultConverter<ESM::Global>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in a new issue