summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-06-29 11:59:40 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-06-29 11:59:40 -0400
commitb81adf898cbe770e1579da5b1618330aac27c671 (patch)
treeee41e10a3f24b3dad9f3ab3938c042c04440b32f /indra/newview/llappearancemgr.cpp
parent1bc0c32fb8593be427a7c7914ecbc31821075a3d (diff)
EXT-8063 FIX, EXT-7986 FIX - enforce wearable counts in updateApperanceFromCOF() if UI lets any improper state through
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 8a3b4cb028..ddbec25c04 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -1598,18 +1598,44 @@ void LLAppearanceMgr::enforceItemCountLimits()
}
}
+class BoolSetter
+{
+public:
+ BoolSetter(bool& var):
+ mVar(var)
+ {
+ mVar = true;
+ }
+ ~BoolSetter()
+ {
+ mVar = false;
+ }
+private:
+ bool& mVar;
+};
+
void LLAppearanceMgr::updateAppearanceFromCOF()
{
- // update dirty flag to see if the state of the COF matches
- // the saved outfit stored as a folder link
+ if (mIsInUpdateAppearanceFromCOF)
+ {
+ llwarns << "Called updateAppearanceFromCOF inside updateAppearanceFromCOF, skipping" << llendl;
+ return;
+ }
+
+ BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF);
+
llinfos << "starting" << llendl;
//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();
+ // Remove duplicate or excess wearables. Should normally be enforced at the UI level, but
+ // this should catch anything that gets through.
enforceItemCountLimits();
+ // update dirty flag to see if the state of the COF matches
+ // the saved outfit stored as a folder link
updateIsDirty();
dumpCat(getCOF(),"COF, start");
@@ -2556,7 +2582,8 @@ void LLAppearanceMgr::dumpItemArray(const LLInventoryModel::item_array_t& items,
LLAppearanceMgr::LLAppearanceMgr():
mAttachmentInvLinkEnabled(false),
- mOutfitIsDirty(false)
+ mOutfitIsDirty(false),
+ mIsInUpdateAppearanceFromCOF(false)
{
LLOutfitObserver& outfit_observer = LLOutfitObserver::instance();