diff options
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rw-r--r-- | indra/newview/llagentwearables.cpp | 87 |
1 files changed, 48 insertions, 39 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 9ff5de29c3..68ee9cd612 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -299,6 +299,10 @@ void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& i { gAgentWearables.makeNewOutfitDone(mType, mIndex); } + if (mTodo & CALL_WEARITEM) + { + LLAppearanceManager::instance().addCOFItemLink(inv_item, true); + } } void LLAgentWearables::addWearabletoAgentInventoryDone(const S32 type, @@ -510,7 +514,7 @@ void LLAgentWearables::saveWearableAs(const EWearableType type, type, index, new_wearable, - addWearableToAgentInventoryCallback::CALL_UPDATE); + addWearableToAgentInventoryCallback::CALL_WEARITEM); LLUUID category_id; if (save_in_lost_and_found) { @@ -1290,25 +1294,29 @@ void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name, j, new_wearable, todo); - if (isWearableCopyable((EWearableType)type, j)) - { - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - folder_id, - new_name, - cb); - } - else + llassert(item); + if (item) { - move_inventory_item( - gAgent.getID(), - gAgent.getSessionID(), - item->getUUID(), - folder_id, - new_name, - cb); + if (isWearableCopyable((EWearableType)type, j)) + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + folder_id, + new_name, + cb); + } + else + { + move_inventory_item( + gAgent.getID(), + gAgent.getSessionID(), + item->getUUID(), + folder_id, + new_name, + cb); + } } } } @@ -1597,31 +1605,32 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it LLWearable* new_wearable = wearables[i]; LLPointer<LLInventoryItem> new_item = items[i]; - const EWearableType type = new_wearable->getType(); - wearables_to_remove[type] = FALSE; - - // MULTI_WEARABLE: using 0th - LLWearable* old_wearable = getWearable(type, 0); - if (old_wearable) + llassert(new_wearable); + if (new_wearable) { - const LLUUID& old_item_id = getWearableItemID(type, 0); - if ((old_wearable->getAssetID() == new_wearable->getAssetID()) && - (old_item_id == new_item->getUUID())) - { - lldebugs << "No change to wearable asset and item: " << LLWearableDictionary::getInstance()->getWearableEntry(type) << llendl; - continue; - } + const EWearableType type = new_wearable->getType(); + wearables_to_remove[type] = FALSE; - // Assumes existing wearables are not dirty. - if (old_wearable->isDirty()) + // MULTI_WEARABLE: using 0th + LLWearable* old_wearable = getWearable(type, 0); + if (old_wearable) { - llassert(0); - continue; + const LLUUID& old_item_id = getWearableItemID(type, 0); + if ((old_wearable->getAssetID() == new_wearable->getAssetID()) && + (old_item_id == new_item->getUUID())) + { + lldebugs << "No change to wearable asset and item: " << LLWearableDictionary::getInstance()->getWearableEntry(type) << llendl; + continue; + } + + // Assumes existing wearables are not dirty. + if (old_wearable->isDirty()) + { + llassert(0); + continue; + } } - } - if (new_wearable) - { new_wearable->setItemID(new_item->getUUID()); setWearable(type,0,new_wearable); } |