diff options
author | andreykproductengine <akleshchev@productengine.com> | 2017-02-03 20:14:42 +0200 |
---|---|---|
committer | andreykproductengine <akleshchev@productengine.com> | 2017-02-03 20:14:42 +0200 |
commit | fd81f83f6b571b16369b7d581198285d5a8ec363 (patch) | |
tree | 00ec17bad6f4c974b20eb1f446cc6007c315df7a /indra/newview/llappearancemgr.cpp | |
parent | c398e5966da98ac2fb7b995c1d89bcf295155506 (diff) |
MAINT-2438 Fixes wrong permissions source
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 43 |
1 files changed, 22 insertions, 21 deletions
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; } } } |