summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llappearancemgr.cpp38
-rwxr-xr-xindra/newview/llappearancemgr.h2
2 files changed, 36 insertions, 4 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 5322646629..98909c258a 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -1821,7 +1821,8 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)
getWearableOrderingDescUpdates(wear_items, desc_map);
// Will link all the above items.
- LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy;
+ // link_waiter enforce flags are false because we've already fixed everything up in updateCOF().
+ LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy(false,false);
LLSD contents = LLSD::emptyArray();
for (LLInventoryModel::item_array_t::const_iterator it = all_items.begin();
@@ -2070,6 +2071,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions,
return;
}
+ llassert(validateClothingOrderingInfo());
+
BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF);
selfStartPhase("update_appearance_from_cof");
@@ -2975,13 +2978,40 @@ void LLAppearanceMgr::getWearableOrderingDescUpdates(LLInventoryModel::item_arra
std::string new_order_str = build_order_string((LLWearableType::EType)type, i);
if (new_order_str == item->getActualDescription()) continue;
- LL_DEBUGS("Avatar") << item->getName() << " need to update desc to: " << new_order_str
- << " (from: " << item->getActualDescription() << ")" << llendl;
-
desc_map[item->getUUID()] = new_order_str;
}
}
}
+
+bool LLAppearanceMgr::validateClothingOrderingInfo(LLUUID cat_id)
+{
+ // COF is processed if cat_id is not specified
+ if (cat_id.isNull())
+ {
+ cat_id = getCOF();
+ }
+
+ LLInventoryModel::item_array_t wear_items;
+ getDescendentsOfAssetType(cat_id, wear_items, LLAssetType::AT_CLOTHING);
+
+ // Identify items for which desc needs to change.
+ desc_map_t desc_map;
+ getWearableOrderingDescUpdates(wear_items, desc_map);
+
+ for (desc_map_t::const_iterator it = desc_map.begin();
+ it != desc_map.end(); ++it)
+ {
+ const LLUUID& item_id = it->first;
+ const std::string& new_order_str = it->second;
+ LLViewerInventoryItem *item = gInventory.getItem(item_id);
+ llwarns << "Order validation fails: " << item->getName()
+ << " needs to update desc to: " << new_order_str
+ << " (from: " << item->getActualDescription() << ")" << llendl;
+ }
+
+ return desc_map.size() == 0;
+}
+
void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id,
LLPointer<LLInventoryCallback> cb)
{
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 3293212719..84a0afbb40 100755
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -208,6 +208,8 @@ public:
//Check ordering information on wearables stored in links' descriptions and update if it is invalid
// COF is processed if cat_id is not specified
+ bool validateClothingOrderingInfo(LLUUID cat_id = LLUUID::null);
+
void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null,
LLPointer<LLInventoryCallback> cb = NULL);