diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-10-23 15:21:49 +0000 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-10-23 15:21:49 +0000 |
commit | 584962d5c79097904fec0102f78ea4aa7482a337 (patch) | |
tree | 95c79b7a41e5c39d3e1f3d7e5710842cd12c3425 /indra/newview/llagentwearables.cpp | |
parent | 9c3ae7a2436c970d3959938ddc29c2d291844ecc (diff) |
svn merge -r137024:137071 svn+ssh://svn.lindenlab.com/svn/linden/branches/avatar-pipeline/avatar-pipeline-14-seraph into svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3
Bugs: EXT-1785 EXT-1818 EXT-1820 EXT-1845
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rw-r--r-- | indra/newview/llagentwearables.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index af2f3613b8..b976e6b2bd 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -794,22 +794,12 @@ const LLUUID LLAgentWearables::getWearableAssetID(EWearableType type, U32 index) return LLUUID(); } -// Warning: include_linked_items = TRUE makes this operation expensive. -BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id, BOOL include_linked_items) const +BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const { - if (getWearableFromItemID(item_id) != NULL) return TRUE; - if (include_linked_items) + const LLUUID& base_item_id = gInventory.getLinkedItemID(item_id); + if (getWearableFromItemID(base_item_id) != NULL) { - LLInventoryModel::item_array_t item_array; - gInventory.collectLinkedItems(item_id, item_array); - for (LLInventoryModel::item_array_t::iterator iter = item_array.begin(); - iter != item_array.end(); - iter++) - { - LLViewerInventoryItem *linked_item = (*iter); - const LLUUID &linked_item_id = linked_item->getUUID(); - if (getWearableFromItemID(linked_item_id) != NULL) return TRUE; - } + return TRUE; } return FALSE; } @@ -1395,8 +1385,9 @@ void LLAgentWearables::removeWearableFinal(const EWearableType type, bool do_rem for (S32 i=max_entry; i>=0; i--) { LLWearable* old_wearable = getWearable(type,i); - gInventory.addChangedMask(LLInventoryObserver::LABEL, getWearableItemID(type,i)); + const LLUUID &item_id = getWearableItemID(type,i); popWearable(type,i); + gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); //queryWearableCache(); // moved below if (old_wearable) @@ -1410,8 +1401,9 @@ void LLAgentWearables::removeWearableFinal(const EWearableType type, bool do_rem { LLWearable* old_wearable = getWearable(type, index); - gInventory.addChangedMask(LLInventoryObserver::LABEL, getWearableItemID(type,index)); + const LLUUID &item_id = getWearableItemID(type,index); popWearable(type, index); + gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); //queryWearableCache(); // moved below @@ -1479,7 +1471,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it } gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id); - // Assumes existing wearables are not dirty. if (old_wearable->isDirty()) { @@ -1501,7 +1492,8 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it { // MULTI_WEARABLE: assuming 0th LLWearable* wearable = getWearable((EWearableType)i, 0); - gInventory.addChangedMask(LLInventoryObserver::LABEL, getWearableItemID((EWearableType)i,0)); + const LLUUID &item_id = getWearableItemID((EWearableType)i,0); + gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); if (wearable) { wearables_being_removed.push_back(wearable); |