From 6fc719813e4ef3a6c9a2950af331b978fbc9cd04 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 19 Mar 2010 11:15:46 -0400 Subject: EXT-6445 After copying an item, changes to new item affect old item Since multiple inventory items can refer to the same asset ID, we needed to revert changes to old_wearable (indexed by asset ID) after saving changes made to a wearable to a new asset ID. This prevents user confusion around unsaved changes. Code reviewed by vir. --- indra/newview/llagentwearables.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 65503d4998..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) -- cgit v1.2.3