mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 00:36:46 +00:00
Merge pull request #2724 from akortunov/factions
Cleanup ownership for items in containers
This commit is contained in:
commit
79517f3f42
2 changed files with 11 additions and 5 deletions
|
@ -290,7 +290,7 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& itemPtr
|
||||||
item.getCellRef().setOwner("");
|
item.getCellRef().setOwner("");
|
||||||
item.getCellRef().resetGlobalVariable();
|
item.getCellRef().resetGlobalVariable();
|
||||||
item.getCellRef().setFaction("");
|
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
|
// 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?
|
// maybe we should do this in the copy constructor instead?
|
||||||
|
|
|
@ -153,14 +153,20 @@ void ESM::CellRef::save (ESMWriter &esm, bool wideRefNum, bool inInventory, bool
|
||||||
esm.writeHNT("XSCL", scale);
|
esm.writeHNT("XSCL", scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!inInventory)
|
||||||
esm.writeHNOCString("ANAM", mOwner);
|
esm.writeHNOCString("ANAM", mOwner);
|
||||||
|
|
||||||
esm.writeHNOCString("BNAM", mGlobalVariable);
|
esm.writeHNOCString("BNAM", mGlobalVariable);
|
||||||
esm.writeHNOCString("XSOL", mSoul);
|
esm.writeHNOCString("XSOL", mSoul);
|
||||||
|
|
||||||
|
if (!inInventory)
|
||||||
|
{
|
||||||
esm.writeHNOCString("CNAM", mFaction);
|
esm.writeHNOCString("CNAM", mFaction);
|
||||||
if (mFactionRank != -2) {
|
if (mFactionRank != -2)
|
||||||
|
{
|
||||||
esm.writeHNT("INDX", mFactionRank);
|
esm.writeHNT("INDX", mFactionRank);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mEnchantmentCharge != -1)
|
if (mEnchantmentCharge != -1)
|
||||||
esm.writeHNT("XCHG", mEnchantmentCharge);
|
esm.writeHNT("XCHG", mEnchantmentCharge);
|
||||||
|
|
Loading…
Reference in a new issue