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