diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2010-06-30 10:20:42 -0400 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2010-06-30 10:20:42 -0400 |
commit | 1c26bb6668e2011315f647359daf56a991c57261 (patch) | |
tree | cb296ba802c570303299c77f860e8cde8d4aa93b /indra/newview/llappearancemgr.cpp | |
parent | 4a3710501b1aeae90afbd48c7e3531c86f92517e (diff) |
EXT-8115 FIX outfits saved under 2.0 load with "unsaved changes"
Added code to save order information to outfits on loading / reverting them.
Order information is updated not only in COF, but also in base outfit folder.
This is only safe to do when we are explicitly loading a saved outfit,
as the COF may have deviated from the saved outfit.
This will also help fix order discrepencies in saved outfits that have been
manually modified through inventory operations.
Fix will only be effective after server 1.40 has rolled out. Tested results
on Aditi to verify effectiveness.
Code Reviewed by Seraph
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index ce022ac840..853369b7c8 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -188,8 +188,9 @@ public: }; -LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(): - mFireCount(0) +LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering): + mFireCount(0), + mUpdateBaseOrder(update_base_outfit_ordering) { } @@ -199,7 +200,7 @@ LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() if (!LLApp::isExiting()) { - LLAppearanceMgr::instance().updateAppearanceFromCOF(); + LLAppearanceMgr::instance().updateAppearanceFromCOF(mUpdateBaseOrder); } } @@ -1417,7 +1418,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) // Create links to new COF contents. llinfos << "creating LLUpdateAppearanceOnDestroy" << llendl; - LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy; + LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy(!append); #ifndef LL_RELEASE_FOR_DOWNLOAD llinfos << "Linking body items" << llendl; @@ -1537,11 +1538,11 @@ bool sort_by_description(const LLInventoryItem* item1, const LLInventoryItem* it return item1->LLInventoryItem::getDescription() < item2->LLInventoryItem::getDescription(); } -void LLAppearanceMgr::updateAppearanceFromCOF() +void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) { //checking integrity of the COF in terms of ordering of wearables, //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state) - updateClothingOrderingInfo(); + updateClothingOrderingInfo(LLUUID::null, update_base_outfit_ordering); // update dirty flag to see if the state of the COF matches // the saved outfit stored as a folder link @@ -2244,11 +2245,19 @@ struct WearablesOrderComparator U32 mControlSize; }; -void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id) +void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base_outfit_ordering) { if (cat_id.isNull()) { cat_id = getCOF(); + if (update_base_outfit_ordering) + { + const LLUUID base_outfit_id = getBaseOutfitUUID(); + if (base_outfit_id.notNull()) + { + updateClothingOrderingInfo(base_outfit_id,false); + } + } } // COF is processed if cat_id is not specified @@ -2281,6 +2290,7 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id) item->setComplete(TRUE); item->updateServer(FALSE); gInventory.updateItem(item); + inventory_changed = true; } } |