summaryrefslogtreecommitdiff
path: root/indra/newview/llagentwearables.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-03-25 20:15:51 -0400
committerLoren Shih <seraph@lindenlab.com>2010-03-25 20:15:51 -0400
commit0a56031bd3e3645a9e5124a722cece0706469944 (patch)
tree39e2244564d2b71d8277231f691160807f8c10b9 /indra/newview/llagentwearables.cpp
parent885fc3f9b54cca33e134bcfb65c1d2a9c0aeec7a (diff)
parentfad31dc087cb670bd4479195cac2c31da9a55e57 (diff)
automated merge
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rw-r--r--indra/newview/llagentwearables.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index f605ad5573..5eb943877a 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -441,6 +441,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)
{
@@ -543,6 +548,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)
@@ -1709,6 +1719,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()))
@@ -1724,7 +1744,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
continue;
}
}
-
+
new_wearable->setItemID(new_item->getUUID());
setWearable(type,0,new_wearable);
}