diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-06-29 11:59:40 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-06-29 11:59:40 -0400 |
commit | b81adf898cbe770e1579da5b1618330aac27c671 (patch) | |
tree | ee41e10a3f24b3dad9f3ab3938c042c04440b32f /indra/newview | |
parent | 1bc0c32fb8593be427a7c7914ecbc31821075a3d (diff) |
EXT-8063 FIX, EXT-7986 FIX - enforce wearable counts in updateApperanceFromCOF() if UI lets any improper state through
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 33 | ||||
-rw-r--r-- | indra/newview/llappearancemgr.h | 1 |
2 files changed, 31 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(); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 15383381f8..afd1bf3ade 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -204,6 +204,7 @@ private: std::set<LLUUID> mRegisteredAttachments; bool mAttachmentInvLinkEnabled; bool mOutfitIsDirty; + bool mIsInUpdateAppearanceFromCOF; // to detect recursive calls. /** * Lock for blocking operations on outfit until server reply or timeout exceed |