diff options
-rwxr-xr-x | indra/newview/llagentwearables.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 010a39a6e7..f6ba879fa7 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1011,7 +1011,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it } // Update only inventory in this case - ordering of wearables with the same asset id has no effect. - // Causes the two-alphas error case in MAINT-4158. + // Updating wearables in this case causes the two-alphas error in MAINT-4158. // We should actually disallow wearing two wearables with the same asset id. if (curr_wearable->getName() != new_item->getName() || curr_wearable->getItemID() != new_item->getUUID()) @@ -1065,7 +1065,8 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it if (new_wearable) { const LLWearableType::EType type = new_wearable->getType(); - + + LLUUID old_wearable_id = new_wearable->getItemID(); new_wearable->setName(new_item->getName()); new_wearable->setItemID(new_item->getUUID()); @@ -1073,11 +1074,18 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it { // exactly one wearable per body part setWearable(type,0,new_wearable); + if (old_wearable_id.notNull()) + { + // we changed id before setting wearable, update old item manually + // to complete the swap. + gInventory.addChangedMask(LLInventoryObserver::LABEL, old_wearable_id); + } } else { pushWearable(type,new_wearable); } + const BOOL removed = FALSE; wearableUpdated(new_wearable, removed); } |