1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-03 21:15:36 +00:00

Reset the 'owner' field for items that were legitimately bought from an NPC.

This commit is contained in:
scrawl 2013-04-07 21:53:11 +02:00
parent f3c8cd2065
commit 480467b6eb

View file

@ -257,6 +257,12 @@ namespace MWGui
MWBase::Environment::get().getDialogueManager()->applyTemporaryDispositionChange(iBarterSuccessDisposition);
// success! make the item transfer.
MWWorld::ContainerStore& playerBoughtItems = mWindowManager.getInventoryWindow()->getBoughtItems();
for (MWWorld::ContainerStoreIterator it = playerBoughtItems.begin(); it != playerBoughtItems.end(); ++it)
{
if (Misc::StringUtils::ciEqual(it->getCellRef().mOwner, MWWorld::Class::get(mPtr).getId(mPtr)))
it->getCellRef().mOwner = "";
}
transferBoughtItems();
mWindowManager.getInventoryWindow()->transferBoughtItems();