Cleanup ownership for items in containers

pull/2724/head
Andrei Kortunov 5 years ago
parent 1fadf259a9
commit ea30e27370

@ -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?

@ -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)

Loading…
Cancel
Save