summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatarself.cpp
diff options
context:
space:
mode:
authorskolb <none@none>2009-10-23 15:34:15 -0700
committerskolb <none@none>2009-10-23 15:34:15 -0700
commit2b69cb9e9cf5209a8156580b74e6662e4cc4243f (patch)
treef38805b6ca5b60e8c0130259865dc610eaee7a0b /indra/newview/llvoavatarself.cpp
parent913786a62b2b8d8e6d9c483ea805a21e694fd818 (diff)
parent4ddaa866dde7a92e56617a32464e0667de3759ef (diff)
Merged change to auto play pref (DEV-41787)
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
-rw-r--r--indra/newview/llvoavatarself.cpp47
1 files changed, 4 insertions, 43 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index de2c30f1a1..2b2ac81487 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -986,11 +986,9 @@ void LLVOAvatarSelf::wearableUpdated( EWearableType type )
//-----------------------------------------------------------------------------
// isWearingAttachment()
//-----------------------------------------------------------------------------
-// Warning: include_linked_items = TRUE makes this operation expensive.
-BOOL LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id, BOOL include_linked_items) const
+BOOL LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id) const
{
- const LLUUID& base_inv_item_id = getBaseAttachmentObject(inv_item_id);
-
+ const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id);
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@@ -1001,30 +999,6 @@ BOOL LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id, BOOL include
return TRUE;
}
}
-
- if (include_linked_items)
- {
- LLInventoryModel::item_array_t item_array;
- gInventory.collectLinkedItems(base_inv_item_id, item_array);
- for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin();
- iter != item_array.end();
- ++iter)
- {
- const LLViewerInventoryItem *linked_item = (*iter);
- const LLUUID &item_id = linked_item->getUUID();
- for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
- iter != mAttachmentPoints.end();
- ++iter)
- {
- const LLViewerJointAttachment* attachment = iter->second;
- if (attachment->getAttachedObject(item_id))
- {
- return TRUE;
- }
- }
- }
- }
-
return FALSE;
}
@@ -1033,7 +1007,7 @@ BOOL LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id, BOOL include
//-----------------------------------------------------------------------------
LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id)
{
- const LLUUID& base_inv_item_id = getBaseAttachmentObject(inv_item_id);
+ const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id);
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@@ -1049,7 +1023,7 @@ LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id)
const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id) const
{
- const LLUUID& base_inv_item_id = getBaseAttachmentObject(inv_item_id);
+ const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id);
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@@ -1087,7 +1061,6 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view
LLAppearanceManager::dumpCat(LLAppearanceManager::getCOF(),"Adding attachment link:");
LLAppearanceManager::wearItem(item,false); // Add COF link for item.
gInventory.addChangedMask(LLInventoryObserver::LABEL, attachment_id);
- gInventory.updateLinkedObjects(attachment_id);
}
}
gInventory.notifyObservers();
@@ -1134,24 +1107,12 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object)
// BAP - needs to change for label to track link.
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
- gInventory.updateLinkedObjects(item_id);
gInventory.notifyObservers();
return TRUE;
}
return FALSE;
}
-const LLUUID& LLVOAvatarSelf::getBaseAttachmentObject(const LLUUID &object_id) const
-{
- const LLInventoryItem *item = gInventory.getItem(object_id);
- if (!item)
- return LLUUID::null;
-
- // Find the base object in case this a link (if it's not a link,
- // this will just be inv_item_id)
- return item->getLinkedUUID();
-}
-
void LLVOAvatarSelf::getAllAttachmentsArray(LLDynamicArray<S32>& attachments)
{
for (LLVOAvatar::attachment_map_t::const_iterator iter = mAttachmentPoints.begin();