summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-11-13 18:27:29 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-11-13 18:27:29 +0200
commitac3db22abcb309898ae7e6dc683cdc80e6532da3 (patch)
tree1014ed46857aa59f18750779d00ed04d4a4aa9c8 /indra/newview/llappearancemgr.cpp
parent8aa41b9e1c18f3b108c2e219e72b6e40762c4652 (diff)
parent04c473ab46041133ea6a87dbe0d43e662472adf5 (diff)
Merge branch 'master' into DRTVWR-518-ui
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 168b8eb47a..e5c505501e 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -3278,6 +3278,50 @@ void update_base_outfit_after_ordering()
bool copy_folder_links = false;
app_mgr.slamCategoryLinks(app_mgr.getCOF(), base_outfit_id, copy_folder_links, dirty_state_updater);
+ if (base_outfit_id.notNull())
+ {
+ LLIsValidItemLink collector;
+
+ LLInventoryModel::cat_array_t cof_cats;
+ LLInventoryModel::item_array_t cof_item_array;
+ gInventory.collectDescendentsIf(app_mgr.getCOF(), cof_cats, cof_item_array,
+ LLInventoryModel::EXCLUDE_TRASH, collector);
+
+ for (U32 i = 0; i < outfit_item_array.size(); ++i)
+ {
+ LLViewerInventoryItem* linked_item = outfit_item_array.at(i)->getLinkedItem();
+ if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE)
+ {
+ outfit_item_array.erase(outfit_item_array.begin() + i);
+ break;
+ }
+ }
+
+ if (outfit_item_array.size() != cof_item_array.size())
+ {
+ return;
+ }
+
+ std::sort(cof_item_array.begin(), cof_item_array.end(), sort_by_linked_uuid);
+ std::sort(outfit_item_array.begin(), outfit_item_array.end(), sort_by_linked_uuid);
+
+ for (U32 i = 0; i < cof_item_array.size(); ++i)
+ {
+ LLViewerInventoryItem *cof_it = cof_item_array.at(i);
+ LLViewerInventoryItem *base_it = outfit_item_array.at(i);
+
+ if (cof_it->getActualDescription() != base_it->getActualDescription())
+ {
+ if (cof_it->getLinkedUUID() == base_it->getLinkedUUID())
+ {
+ base_it->setDescription(cof_it->getActualDescription());
+ gInventory.updateItem(base_it);
+ }
+ }
+ }
+ LLAppearanceMgr::getInstance()->updateIsDirty();
+ }
+
}
// Save COF changes - update the contents of the current base outfit