diff options
author | Roxie Linden <roxie@lindenlab.com> | 2010-03-22 16:12:41 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2010-03-22 16:12:41 -0700 |
commit | 18b7ab0018695e261dbc5058d76f9d371958b034 (patch) | |
tree | 9b4baa5a5ca563ace1b06ac6b3df9fd9c0a0d0f7 /indra/newview/llagentwearables.cpp | |
parent | 60c4621500e478d66a8bdc3a1c80573be2860fee (diff) | |
parent | be139dfb957e1b0d3c59110284c43630d3b57d23 (diff) |
Weekly automated merge from viewer 2.0
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rw-r--r-- | indra/newview/llagentwearables.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index ea10917901..ebadd8a165 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -443,6 +443,11 @@ void LLAgentWearables::saveWearable(const EWearableType type, const U32 index, B new_wearable->setItemID(old_item_id); // should this be in LLWearable::copyDataFrom()? setWearable(type,index,new_wearable); + // old_wearable may still be referred to by other inventory items. Revert + // unsaved changes so other inventory items aren't affected by the changes + // that were just saved. + old_wearable->revertValues(); + LLInventoryItem* item = gInventory.getItem(old_item_id); if (item) { @@ -545,6 +550,11 @@ void LLAgentWearables::saveWearableAs(const EWearableType type, category_id, new_name, cb); + + // old_wearable may still be referred to by other inventory items. Revert + // unsaved changes so other inventory items aren't affected by the changes + // that were just saved. + old_wearable->revertValues(); } void LLAgentWearables::revertWearable(const EWearableType type, const U32 index) @@ -1702,6 +1712,16 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it LLWearable* old_wearable = getWearable(type, 0); if (old_wearable) { + // Special case where you're putting on a wearable that has the same assetID + // as the previous (e.g. wear a shirt then wear a copy of that shirt) since in this + // case old_wearable == new_wearable. + if (old_wearable == new_wearable) + { + old_wearable->setLabelUpdated(); + new_wearable->setName(new_item->getName()); + new_wearable->setItemID(new_item->getUUID()); + } + const LLUUID& old_item_id = getWearableItemID(type, 0); if ((old_wearable->getAssetID() == new_wearable->getAssetID()) && (old_item_id == new_item->getUUID())) @@ -1717,7 +1737,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it continue; } } - + new_wearable->setItemID(new_item->getUUID()); setWearable(type,0,new_wearable); } |