MAINT-4537 WIP - comments and cleanup
parent
b1884d40f5
commit
7b6131fbf9
|
|
@ -1105,10 +1105,10 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
|
|||
|
||||
notifyLoadingFinished();
|
||||
|
||||
// Have to copy wearable params to avatar
|
||||
// Copy wearable params to avatar.
|
||||
gAgentAvatarp->writeWearablesToAvatar();
|
||||
|
||||
// ... before this will do anything.
|
||||
// Then update the avatar based on the copied params.
|
||||
gAgentAvatarp->updateVisualParams();
|
||||
|
||||
gAgentAvatarp->dumpAvatarTEs("setWearableOutfit");
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
// 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();
|
||||
|
||||
// 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 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);
|
||||
}
|
||||
|
||||
// Update attachments to match those requested.
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue