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,14 +863,37 @@ void LLAppearanceManager::wearOutfitByName(const std::string& name) ...@@ -863,14 +863,37 @@ 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;
LLPointer<LLInventoryCallback> cb = do_update ? new ModifiedCOFCallback : 0; LLInventoryModel::item_array_t item_array;
link_inventory_item( gAgent.getID(), gInventory.collectDescendents(LLAppearanceManager::getCOF(),
item->getLinkedUUID(), cat_array,
getCOF(), item_array,
item->getName(), LLInventoryModel::EXCLUDE_TRASH);
LLAssetType::AT_LINK, bool linked_already = false;
cb); 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;
link_inventory_item( gAgent.getID(),
item->getLinkedUUID(),
getCOF(),
item->getName(),
LLAssetType::AT_LINK,
cb);
}
} }
/* static */ /* static */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment