summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2010-06-30 10:20:42 -0400
committerNyx (Neal Orman) <nyx@lindenlab.com>2010-06-30 10:20:42 -0400
commit1c26bb6668e2011315f647359daf56a991c57261 (patch)
treecb296ba802c570303299c77f860e8cde8d4aa93b /indra
parent4a3710501b1aeae90afbd48c7e3531c86f92517e (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')
-rw-r--r--indra/newview/llappearancemgr.cpp24
-rw-r--r--indra/newview/llappearancemgr.h7
2 files changed, 21 insertions, 10 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;
}
}
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 61779d5c0e..5a556a4102 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -54,7 +54,7 @@ class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr>
public:
typedef std::vector<LLInventoryModel::item_array_t> wearables_by_type_t;
- void updateAppearanceFromCOF();
+ void updateAppearanceFromCOF(bool update_base_outfit_ordering = false);
bool needToSaveCOF();
void updateCOF(const LLUUID& category, bool append = false);
void wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append);
@@ -170,7 +170,7 @@ 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
- void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null);
+ void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null, bool update_base_outfit_ordering = false);
bool isOutfitLocked() { return mOutfitLocked; }
@@ -224,12 +224,13 @@ public:
class LLUpdateAppearanceOnDestroy: public LLInventoryCallback
{
public:
- LLUpdateAppearanceOnDestroy();
+ LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering = false);
virtual ~LLUpdateAppearanceOnDestroy();
/* virtual */ void fire(const LLUUID& inv_item);
private:
U32 mFireCount;
+ bool mUpdateBaseOrder;
};