diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-09-11 10:45:14 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-09-11 10:45:14 -0400 |
commit | dad3090afcd56d1122ca5d6016001bc5226de4da (patch) | |
tree | 97a5fe2edb16606650e3a2ad2d000d7b342c2ced /indra/newview | |
parent | 683c36ae2f81bd08d83d7e37c60f447196635834 (diff) |
SH-4422 WIP - avoid redundant calls to updateAppearanceFromCOF() if rezzing an attachment that's already linked in COF
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llappearancemgr.cpp | 13 | ||||
-rwxr-xr-x | indra/newview/llappearancemgr.h | 1 |
2 files changed, 12 insertions, 2 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 7fbe84312e..359d5aaa5c 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2590,6 +2590,12 @@ LLInventoryModel::item_array_t LLAppearanceMgr::findCOFItemLinks(const LLUUID& i return result; } +bool LLAppearanceMgr::isLinkedInCOF(const LLUUID& item_id) +{ + LLInventoryModel::item_array_t links = LLAppearanceMgr::instance().findCOFItemLinks(item_id); + return links.size() > 0; +} + void LLAppearanceMgr::removeAllClothesFromAvatar() { // Fetch worn clothes (i.e. the ones in COF). @@ -3799,8 +3805,11 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) // we have to pass do_update = true to call LLAppearanceMgr::updateAppearanceFromCOF. // it will trigger gAgentWariables.notifyLoadingFinished() // But it is not acceptable solution. See EXT-7777 - LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy(); - LLAppearanceMgr::addCOFItemLink(item_id, cb); // Add COF link for item. + if (!isLinkedInCOF(item_id)) + { + LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy(); + LLAppearanceMgr::addCOFItemLink(item_id, cb); // Add COF link for item. + } } else { diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 3a90c3840a..2a882fd977 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -145,6 +145,7 @@ public: // Find COF entries referencing the given item. LLInventoryModel::item_array_t findCOFItemLinks(const LLUUID& item_id); + bool isLinkedInCOF(const LLUUID& item_id); // Remove COF entries void removeCOFItemLinks(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb = NULL); |