summaryrefslogtreecommitdiff
path: root/indra/newview/llattachmentsmgr.cpp
diff options
context:
space:
mode:
authorHoward Stearns <howard.stearns@gmail.com>2022-02-28 15:54:23 -0800
committerHoward Stearns <howard.stearns@gmail.com>2022-02-28 15:54:23 -0800
commit130d0c0704c97a427bc28f9164f71ce67535e894 (patch)
treeb27e61d8c2e3aeb91ecd1b0b8177ff2a7bdb665e /indra/newview/llattachmentsmgr.cpp
parent932b7de5309bc8599655ebb77666c41f5a81cfa9 (diff)
parent6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff)
Merge branch 'master' of bitbucket.org:lindenlab/viewer into SL-9749
Diffstat (limited to 'indra/newview/llattachmentsmgr.cpp')
-rw-r--r--indra/newview/llattachmentsmgr.cpp112
1 files changed, 58 insertions, 54 deletions
diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp
index 0fd6009074..d43048a8b6 100644
--- a/indra/newview/llattachmentsmgr.cpp
+++ b/indra/newview/llattachmentsmgr.cpp
@@ -99,22 +99,22 @@ void LLAttachmentsMgr::onIdle()
return;
}
- if (LLApp::isExiting())
- {
- return;
- }
+ if (LLApp::isExiting())
+ {
+ return;
+ }
requestPendingAttachments();
- linkRecentlyArrivedAttachments();
+ linkRecentlyArrivedAttachments();
- expireOldAttachmentRequests();
+ expireOldAttachmentRequests();
- expireOldDetachRequests();
+ expireOldDetachRequests();
- checkInvalidCOFLinks();
-
- spamStatusInfo();
+ checkInvalidCOFLinks();
+
+ spamStatusInfo();
}
void LLAttachmentsMgr::requestPendingAttachments()
@@ -453,51 +453,55 @@ bool LLAttachmentsMgr::isAttachmentStateComplete() const
//
void LLAttachmentsMgr::checkInvalidCOFLinks()
{
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t item_array;
- gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(),
- cat_array,item_array,LLInventoryModel::EXCLUDE_TRASH);
- for (S32 i=0; i<item_array.size(); i++)
- {
- const LLViewerInventoryItem* inv_item = item_array.at(i).get();
- const LLUUID& item_id = inv_item->getLinkedUUID();
- if (inv_item->getType() == LLAssetType::AT_OBJECT)
- {
- LLTimer timer;
- bool is_flagged_questionable = mQuestionableCOFLinks.getTime(item_id,timer);
- bool is_wearing_attachment = isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(item_id);
- if (is_wearing_attachment && is_flagged_questionable)
- {
- LL_DEBUGS("Avatar") << "ATT was flagged questionable but is now "
- << (is_wearing_attachment ? "attached " : "")
- <<"removing flag after "
- << timer.getElapsedTimeF32() << " item "
- << inv_item->getName() << " id " << item_id << LL_ENDL;
- mQuestionableCOFLinks.removeTime(item_id);
- }
- }
- }
+ if (!gInventory.isInventoryUsable())
+ {
+ return;
+ }
+ LLInventoryModel::cat_array_t cat_array;
+ LLInventoryModel::item_array_t item_array;
+ gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(),
+ cat_array,item_array,LLInventoryModel::EXCLUDE_TRASH);
+ for (S32 i=0; i<item_array.size(); i++)
+ {
+ const LLViewerInventoryItem* inv_item = item_array.at(i).get();
+ const LLUUID& item_id = inv_item->getLinkedUUID();
+ if (inv_item->getType() == LLAssetType::AT_OBJECT)
+ {
+ LLTimer timer;
+ bool is_flagged_questionable = mQuestionableCOFLinks.getTime(item_id,timer);
+ bool is_wearing_attachment = isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(item_id);
+ if (is_wearing_attachment && is_flagged_questionable)
+ {
+ LL_DEBUGS("Avatar") << "ATT was flagged questionable but is now "
+ << (is_wearing_attachment ? "attached " : "")
+ <<"removing flag after "
+ << timer.getElapsedTimeF32() << " item "
+ << inv_item->getName() << " id " << item_id << LL_ENDL;
+ mQuestionableCOFLinks.removeTime(item_id);
+ }
+ }
+ }
- for(LLItemRequestTimes::iterator it = mQuestionableCOFLinks.begin();
- it != mQuestionableCOFLinks.end(); )
- {
- LLItemRequestTimes::iterator curr_it = it;
- ++it;
- const LLUUID& item_id = curr_it->first;
- LLViewerInventoryItem *inv_item = gInventory.getItem(item_id);
- if (curr_it->second.getElapsedTimeF32() > MAX_BAD_COF_TIME)
- {
- if (LLAppearanceMgr::instance().isLinkedInCOF(item_id))
- {
- LL_DEBUGS("Avatar") << "ATT Linked in COF but not attached or requested, deleting link after "
- << curr_it->second.getElapsedTimeF32() << " seconds for "
- << (inv_item ? inv_item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL;
- LLAppearanceMgr::instance().removeCOFItemLinks(item_id);
- }
- mQuestionableCOFLinks.erase(curr_it);
- continue;
- }
- }
+ for(LLItemRequestTimes::iterator it = mQuestionableCOFLinks.begin();
+ it != mQuestionableCOFLinks.end(); )
+ {
+ LLItemRequestTimes::iterator curr_it = it;
+ ++it;
+ const LLUUID& item_id = curr_it->first;
+ LLViewerInventoryItem *inv_item = gInventory.getItem(item_id);
+ if (curr_it->second.getElapsedTimeF32() > MAX_BAD_COF_TIME)
+ {
+ if (LLAppearanceMgr::instance().isLinkedInCOF(item_id))
+ {
+ LL_DEBUGS("Avatar") << "ATT Linked in COF but not attached or requested, deleting link after "
+ << curr_it->second.getElapsedTimeF32() << " seconds for "
+ << (inv_item ? inv_item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL;
+ LLAppearanceMgr::instance().removeCOFItemLinks(item_id);
+ }
+ mQuestionableCOFLinks.erase(curr_it);
+ continue;
+ }
+ }
}
void LLAttachmentsMgr::spamStatusInfo()