summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2014-11-15 14:36:30 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2014-11-15 14:36:30 -0500
commit7b6131fbf9c083d7d81f5f791ffe104df4f40aa3 (patch)
tree5a624dfdea661191130348a606d293cd18d3853f /indra/newview/llappearancemgr.cpp
parentb1884d40f5ba74d1d39be1abad7dc416905c6caf (diff)
MAINT-4537 WIP - comments and cleanup
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rwxr-xr-xindra/newview/llappearancemgr.cpp51
1 files changed, 29 insertions, 22 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 943190e7b1..e6cf048cec 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -807,12 +807,13 @@ void LLWearableHoldingPattern::onAllComplete()
}
}
- LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.size() << " attachments" << LL_ENDL;
- LLAgentWearables::llvo_vec_t objects_to_remove;
- LLAgentWearables::llvo_vec_t objects_to_retain;
- LLInventoryModel::item_array_t items_to_add;
if (isAgentAvatarValid())
{
+ LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.size() << " attachments" << LL_ENDL;
+ LLAgentWearables::llvo_vec_t objects_to_remove;
+ LLAgentWearables::llvo_vec_t objects_to_retain;
+ LLInventoryModel::item_array_t items_to_add;
+
LLAgentWearables::findAttachmentsAddRemoveInfo(mObjItems,
objects_to_remove,
objects_to_retain,
@@ -820,26 +821,32 @@ void LLWearableHoldingPattern::onAllComplete()
LL_DEBUGS("Avatar") << self_av_string() << "Removing " << objects_to_remove.size()
<< " attachments" << LL_ENDL;
- gAgentAvatarp->clearAttachmentPosOverrides();
- LLAgentWearables::userRemoveMultipleAttachments(objects_to_remove);
- }
- // Update wearables.
- LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " updating agent wearables with " << mResolved << " wearable items " << LL_ENDL;
- LLAppearanceMgr::instance().updateAgentWearables(this);
-
- // Restore attachment pos overrides for the attachments that aren't going away.
- for (LLAgentWearables::llvo_vec_t::iterator it = objects_to_retain.begin();
- it != objects_to_retain.end();
- ++it)
- {
- LLViewerObject *objectp = *it;
- gAgentAvatarp->addAttachmentPosOverridesForObject(objectp);
- }
+ // Here we remove the attachment pos overrides for *all*
+ // attachments, even those that are not being removed. This is
+ // needed to get joint positions all slammed down to their
+ // pre-attachment states.
+ gAgentAvatarp->clearAttachmentPosOverrides();
- // Update attachments to match those requested.
- if (isAgentAvatarValid())
- {
+ // Take off the attachments that will no longer be in the outfit.
+ LLAgentWearables::userRemoveMultipleAttachments(objects_to_remove);
+
+ // Update wearables.
+ LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " updating agent wearables with "
+ << mResolved << " wearable items " << LL_ENDL;
+ LLAppearanceMgr::instance().updateAgentWearables(this);
+
+ // Restore attachment pos overrides for the attachments that
+ // are remaining in the outfit.
+ for (LLAgentWearables::llvo_vec_t::iterator it = objects_to_retain.begin();
+ it != objects_to_retain.end();
+ ++it)
+ {
+ LLViewerObject *objectp = *it;
+ gAgentAvatarp->addAttachmentPosOverridesForObject(objectp);
+ }
+
+ // Add new attachments to match those requested.
LL_DEBUGS("Avatar") << self_av_string() << "Adding " << items_to_add.size() << " attachments" << LL_ENDL;
LLAgentWearables::userAttachMultipleAttachments(items_to_add);
}