1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-06 07:15:36 +00:00

Cleanup ownership for items in containers

This commit is contained in:
Andrei Kortunov 2020-03-17 17:12:04 +04:00
parent 1fadf259a9
commit ea30e27370
2 changed files with 11 additions and 5 deletions

View file

@ -290,7 +290,7 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& itemPtr
item.getCellRef().setOwner("");
item.getCellRef().resetGlobalVariable();
item.getCellRef().setFaction("");
item.getCellRef().setFactionRank(-1);
item.getCellRef().setFactionRank(-2);
// must reset the RefNum on the copied item, so that the RefNum on the original item stays unique
// maybe we should do this in the copy constructor instead?

View file

@ -153,13 +153,19 @@ void ESM::CellRef::save (ESMWriter &esm, bool wideRefNum, bool inInventory, bool
esm.writeHNT("XSCL", scale);
}
esm.writeHNOCString("ANAM", mOwner);
if (!inInventory)
esm.writeHNOCString("ANAM", mOwner);
esm.writeHNOCString("BNAM", mGlobalVariable);
esm.writeHNOCString("XSOL", mSoul);
esm.writeHNOCString("CNAM", mFaction);
if (mFactionRank != -2) {
esm.writeHNT("INDX", mFactionRank);
if (!inInventory)
{
esm.writeHNOCString("CNAM", mFaction);
if (mFactionRank != -2)
{
esm.writeHNT("INDX", mFactionRank);
}
}
if (mEnchantmentCharge != -1)