From fd81f83f6b571b16369b7d581198285d5a8ec363 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 3 Feb 2017 20:14:42 +0200 Subject: MAINT-2438 Fixes wrong permissions source --- indra/newview/llappearancemgr.cpp | 43 ++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 21 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 046e829070..35d08c7ab1 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1246,31 +1246,32 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLViewerWearable *wearable) data.mWearable = wearable; use_count++; } - else if (wearable->getPermissions().allowModifyBy(gAgent.getID())) + else { - // We can't edit and do some other interactions with same asset twice, copy it - LLViewerWearable* new_wearable = LLWearableList::instance().createCopy(wearable, wearable->getName()); - data.mWearable = new_wearable; - data.mAssetID = new_wearable->getAssetID(); - - LLViewerInventoryItem* item = gInventory.getItem(data.mItemID); - if (item) + LLViewerInventoryItem* wearable_item = gInventory.getItem(data.mItemID); + if (wearable_item && wearable_item->getPermissions().allowModifyBy(gAgentID)) { + // We can't edit and do some other interactions with same asset twice, copy it + LLViewerWearable* new_wearable = LLWearableList::instance().createCopy(wearable, wearable->getName()); + data.mWearable = new_wearable; + data.mAssetID = new_wearable->getAssetID(); + // Update existing inventory item - item->setAssetUUID(new_wearable->getAssetID()); - item->setTransactionID(new_wearable->getTransactionID()); - gInventory.updateItem(item, LLInventoryObserver::INTERNAL); - item->updateServer(FALSE); + wearable_item->setAssetUUID(new_wearable->getAssetID()); + wearable_item->setTransactionID(new_wearable->getTransactionID()); + gInventory.updateItem(wearable_item, LLInventoryObserver::INTERNAL); + wearable_item->updateServer(FALSE); + + use_count++; + } + else + { + // Note: technically a bug, LLViewerWearable can identify only one item id at a time, + // yet we are tying it to multiple items here. + // LLViewerWearable need to support more then one item. + LL_WARNS() << "Same LLViewerWearable is used by multiple items! " << wearable->getAssetID() << LL_ENDL; + data.mWearable = wearable; } - use_count++; - } - else - { - // Note: technically a bug, LLViewerWearable can identify only one item id at a time, - // yet we are tying it to multiple items here. - // LLViewerWearable need to support more then one item. - LL_WARNS() << "Same LLViewerWearable is used by multiple items! " << wearable->getAssetID() << LL_ENDL; - data.mWearable = wearable; } } } -- cgit v1.2.3