@@ -708,7 +708,6 @@ class LLWearableHoldingPattern
708
708
found_list_t & getFoundList ();
709
709
void eraseTypeToLink (LLWearableType::EType type);
710
710
void eraseTypeToRecover (LLWearableType::EType type);
711
- void setObjItems (const LLInventoryModel::item_array_t & items);
712
711
void setGestItems (const LLInventoryModel::item_array_t & items);
713
712
bool isMostRecent ();
714
713
void handleLateArrivals ();
@@ -718,7 +717,6 @@ class LLWearableHoldingPattern
718
717
719
718
private:
720
719
found_list_t mFoundList ;
721
- LLInventoryModel::item_array_t mObjItems ;
722
720
LLInventoryModel::item_array_t mGestItems ;
723
721
typedef std::set<S32> type_set_t ;
724
722
type_set_t mTypesToRecover ;
@@ -795,11 +793,6 @@ void LLWearableHoldingPattern::eraseTypeToRecover(LLWearableType::EType type)
795
793
mTypesToRecover .erase (type);
796
794
}
797
795
798
- void LLWearableHoldingPattern::setObjItems (const LLInventoryModel::item_array_t & items)
799
- {
800
- mObjItems = items;
801
- }
802
-
803
796
void LLWearableHoldingPattern::setGestItems (const LLInventoryModel::item_array_t & items)
804
797
{
805
798
mGestItems = items;
@@ -905,55 +898,10 @@ void LLWearableHoldingPattern::onAllComplete()
905
898
906
899
if (isAgentAvatarValid ())
907
900
{
908
- LL_DEBUGS (" Avatar" ) << self_av_string () << " Updating " << mObjItems .size () << " attachments" << LL_ENDL;
909
- LLAgentWearables::llvo_vec_t objects_to_remove;
910
- LLAgentWearables::llvo_vec_t objects_to_retain;
911
- LLInventoryModel::item_array_t items_to_add;
912
-
913
- LLAgentWearables::findAttachmentsAddRemoveInfo (mObjItems ,
914
- objects_to_remove,
915
- objects_to_retain,
916
- items_to_add);
917
-
918
- LL_DEBUGS (" Avatar" ) << self_av_string () << " Removing " << objects_to_remove.size ()
919
- << " attachments" << LL_ENDL;
920
-
921
- // Here we remove the attachment pos overrides for *all*
922
- // attachments, even those that are not being removed. This is
923
- // needed to get joint positions all slammed down to their
924
- // pre-attachment states.
925
- gAgentAvatarp ->clearAttachmentOverrides ();
926
-
927
- if (objects_to_remove.size () || items_to_add.size ())
928
- {
929
- LL_DEBUGS (" Avatar" ) << " ATT will remove " << objects_to_remove.size ()
930
- << " and add " << items_to_add.size () << " items" << LL_ENDL;
931
- }
932
-
933
- // Take off the attachments that will no longer be in the outfit.
934
- LLAgentWearables::userRemoveMultipleAttachments (objects_to_remove);
935
-
936
901
// Update wearables.
937
902
LL_INFOS (" Avatar" ) << self_av_string () << " HP " << index () << " updating agent wearables with "
938
903
<< mResolved << " wearable items " << LL_ENDL;
939
904
LLAppearanceMgr::instance ().updateAgentWearables (this );
940
-
941
- // Restore attachment pos overrides for the attachments that
942
- // are remaining in the outfit.
943
- for (LLAgentWearables::llvo_vec_t ::iterator it = objects_to_retain.begin ();
944
- it != objects_to_retain.end ();
945
- ++it)
946
- {
947
- LLViewerObject *objectp = *it;
948
- if (!objectp->isAnimatedObject ())
949
- {
950
- gAgentAvatarp ->addAttachmentOverridesForObject (objectp);
951
- }
952
- }
953
-
954
- // Add new attachments to match those requested.
955
- LL_DEBUGS (" Avatar" ) << self_av_string () << " Adding " << items_to_add.size () << " attachments" << LL_ENDL;
956
- LLAgentWearables::userAttachMultipleAttachments (items_to_add);
957
905
}
958
906
959
907
if (isFetchCompleted () && isMissingCompleted ())
@@ -2584,6 +2532,56 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions,
2584
2532
<< " descendent_count " << cof->getDescendentCount ()
2585
2533
<< " viewer desc count " << cof->getViewerDescendentCount () << LL_ENDL;
2586
2534
}
2535
+
2536
+ // Update attachments to match those requested.
2537
+ if (isAgentAvatarValid ())
2538
+ {
2539
+ LL_DEBUGS (" Avatar" ) << self_av_string () << " Updating " << obj_items.size () << " attachments" << LL_ENDL;
2540
+ LLAgentWearables::llvo_vec_t objects_to_remove;
2541
+ LLAgentWearables::llvo_vec_t objects_to_retain;
2542
+ LLInventoryModel::item_array_t items_to_add;
2543
+
2544
+ LLAgentWearables::findAttachmentsAddRemoveInfo (obj_items,
2545
+ objects_to_remove,
2546
+ objects_to_retain,
2547
+ items_to_add);
2548
+
2549
+ LL_DEBUGS (" Avatar" ) << self_av_string () << " Removing " << objects_to_remove.size ()
2550
+ << " attachments" << LL_ENDL;
2551
+
2552
+ // Here we remove the attachment pos overrides for *all*
2553
+ // attachments, even those that are not being removed. This is
2554
+ // needed to get joint positions all slammed down to their
2555
+ // pre-attachment states.
2556
+ gAgentAvatarp ->clearAttachmentOverrides ();
2557
+
2558
+ if (objects_to_remove.size () || items_to_add.size ())
2559
+ {
2560
+ LL_DEBUGS (" Avatar" ) << " ATT will remove " << objects_to_remove.size ()
2561
+ << " and add " << items_to_add.size () << " items" << LL_ENDL;
2562
+ }
2563
+
2564
+ // Take off the attachments that will no longer be in the outfit.
2565
+ LLAgentWearables::userRemoveMultipleAttachments (objects_to_remove);
2566
+
2567
+ // Restore attachment pos overrides for the attachments that
2568
+ // are remaining in the outfit.
2569
+ for (LLAgentWearables::llvo_vec_t ::iterator it = objects_to_retain.begin ();
2570
+ it != objects_to_retain.end ();
2571
+ ++it)
2572
+ {
2573
+ LLViewerObject *objectp = *it;
2574
+ if (!objectp->isAnimatedObject ())
2575
+ {
2576
+ gAgentAvatarp ->addAttachmentOverridesForObject (objectp);
2577
+ }
2578
+ }
2579
+
2580
+ // Add new attachments to match those requested.
2581
+ LL_DEBUGS (" Avatar" ) << self_av_string () << " Adding " << items_to_add.size () << " attachments" << LL_ENDL;
2582
+ LLAgentWearables::userAttachMultipleAttachments (items_to_add);
2583
+ }
2584
+
2587
2585
if (!wear_items.size ())
2588
2586
{
2589
2587
LLNotificationsUtil::add (" CouldNotPutOnOutfit" );
@@ -2598,7 +2596,6 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions,
2598
2596
LLTimer hp_block_timer;
2599
2597
LLWearableHoldingPattern* holder = new LLWearableHoldingPattern;
2600
2598
2601
- holder->setObjItems (obj_items);
2602
2599
holder->setGestItems (gest_items);
2603
2600
2604
2601
// Note: can't do normal iteration, because if all the
0 commit comments