summaryrefslogtreecommitdiff
path: root/indra/newview/llagentwearables.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rw-r--r--indra/newview/llagentwearables.cpp65
1 files changed, 37 insertions, 28 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index d560331392..6078620e87 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -310,21 +310,24 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const S32 type,
return;
LLUUID old_item_id = getWearableItemID((EWearableType)type,index);
+
if (wearable)
{
wearable->setItemID(item_id);
- }
- if (old_item_id.notNull())
- {
- gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id);
- setWearable((EWearableType)type,index,wearable);
- }
- else
- {
- pushWearable((EWearableType)type,wearable);
+ if (old_item_id.notNull())
+ {
+ gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id);
+ setWearable((EWearableType)type,index,wearable);
+ }
+ else
+ {
+ pushWearable((EWearableType)type,wearable);
+ }
}
+
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
+
LLViewerInventoryItem* item = gInventory.getItem(item_id);
if (item && wearable)
{
@@ -1287,25 +1290,29 @@ void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name,
j,
new_wearable,
todo);
- if (isWearableCopyable((EWearableType)type, j))
+ llassert(item);
+ if (item)
{
- 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);
+ 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);
+ }
}
}
}
@@ -1618,8 +1625,10 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
}
if (new_wearable)
+ {
new_wearable->setItemID(new_item->getUUID());
- setWearable(type,0,new_wearable);
+ setWearable(type,0,new_wearable);
+ }
}
std::vector<LLWearable*> wearables_being_removed;