Skip to content
Snippets Groups Projects
Commit af774fc9 authored by Bradley Payne's avatar Bradley Payne
Browse files

For EXT-1121: Attaching / detaching objects doesn't affect the Current Outfit...

For EXT-1121: Attaching / detaching objects doesn't affect the Current Outfit folder and EXT-1090: Attachments detach on login.

This is still in short term fix territory - trying to avoid creating duplicate attachment links when wearing outfits.  It's not 100% robust because of the possibility of race conditions.
parent 8bdd77f1
No related branches found
No related tags found
No related merge requests found
...@@ -863,7 +863,29 @@ void LLAppearanceManager::wearOutfitByName(const std::string& name) ...@@ -863,7 +863,29 @@ void LLAppearanceManager::wearOutfitByName(const std::string& name)
/* static */ /* static */
void LLAppearanceManager::wearItem( LLInventoryItem* item, bool do_update ) void LLAppearanceManager::wearItem( LLInventoryItem* item, bool do_update )
{ {
// BAP add check for already in COF. LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
gInventory.collectDescendents(LLAppearanceManager::getCOF(),
cat_array,
item_array,
LLInventoryModel::EXCLUDE_TRASH);
bool linked_already = false;
for (S32 i=0; i<item_array.count(); i++)
{
const LLInventoryItem* inv_item = item_array.get(i).get();
if (inv_item->getLinkedUUID() == item->getLinkedUUID())
{
linked_already = true;
break;
}
}
if (linked_already)
{
if (do_update)
LLAppearanceManager::updateAppearanceFromCOF();
}
else
{
LLPointer<LLInventoryCallback> cb = do_update ? new ModifiedCOFCallback : 0; LLPointer<LLInventoryCallback> cb = do_update ? new ModifiedCOFCallback : 0;
link_inventory_item( gAgent.getID(), link_inventory_item( gAgent.getID(),
item->getLinkedUUID(), item->getLinkedUUID(),
...@@ -872,6 +894,7 @@ void LLAppearanceManager::wearItem( LLInventoryItem* item, bool do_update ) ...@@ -872,6 +894,7 @@ void LLAppearanceManager::wearItem( LLInventoryItem* item, bool do_update )
LLAssetType::AT_LINK, LLAssetType::AT_LINK,
cb); cb);
} }
}
/* static */ /* static */
void LLAppearanceManager::wearEnsemble( LLInventoryCategory* cat, bool do_update ) void LLAppearanceManager::wearEnsemble( LLInventoryCategory* cat, bool do_update )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment