- fixed : Add to/Replace Outfit removes newly worn attachments on completion

-> additional fix for http://jira.secondlife.com/browse/VWR-18512
    -> moved to Appearance-Misc branch as well, we'll remove it from RLVa as soon as we make RLVa dependant on it

--HG--
branch : RLVa
meow-7.2.2
Kitty Barnett 2010-08-31 16:33:37 +02:00
parent f0c145544d
commit d9e61bc4f9
2 changed files with 54 additions and 1 deletions

View File

@ -1885,6 +1885,29 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
remove_non_link_items(obj_items);
remove_non_link_items(gest_items);
// [RLVa:KB] - Checked: 2010-08-31 (RLVa-1.2.1c) | Added: RLVa-1.2.1c
// Include attachments which should be in COF but don't have their link created yet
if (isAgentAvatarValid())
{
uuid_vec_t::iterator itPendingObjLink = mPendingObjLinks.begin();
while (itPendingObjLink != mPendingObjLinks.end())
{
const LLUUID& idItem = *itPendingObjLink;
if (!gAgentAvatarp->isWearingAttachment(idItem))
{
mPendingObjLinks.erase(itPendingObjLink++);
continue;
}
LLViewerInventoryItem* pItem = gInventory.getItem(idItem);
if (pItem)
obj_items.push_back(pItem);
++itPendingObjLink;
}
}
// [/RLVa:KB]
dumpItemArray(wear_items,"asset_dump: wear_item");
dumpItemArray(obj_items,"asset_dump: obj_item");
@ -2906,7 +2929,11 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id)
// we have to pass do_update = true to call LLAppearanceMgr::updateAppearanceFromCOF.
// it will trigger gAgentWariables.notifyLoadingFinished()
// But it is not acceptable solution. See EXT-7777
LLAppearanceMgr::addCOFItemLink(item_id, false); // Add COF link for item.
// LLAppearanceMgr::addCOFItemLink(item_id, false); // Add COF link for item.
// [RLVa:KB] - Checked: 2010-08-31 (RLVa-1.2.1c) | Added: RLVa-1.2.1c
mPendingObjLinks.push_back(item_id);
LLAppearanceMgr::addCOFItemLink(item_id, false, new LLRegisterAttachmentCallback()); // Add COF link for item.
// [/RLVa:KB]
}
else
{

View File

@ -224,6 +224,19 @@ private:
std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
// [RLVa:KB] - Checked: 2010-08-31 (RLVa-1.2.1c) | Added: RLVa-1.2.1c
public:
void onRegisterAttachmentComplete(const LLUUID& idItem)
{
const LLUUID& idItemBase = gInventory.getLinkedItemID(idItem);
uuid_vec_t::const_iterator itPendingObjLink = std::find(mPendingObjLinks.begin(), mPendingObjLinks.end(), idItemBase);
if (itPendingObjLink != mPendingObjLinks.end())
mPendingObjLinks.erase(itPendingObjLink);
}
private:
uuid_vec_t mPendingObjLinks;
// [/RLVa:KB]
//////////////////////////////////////////////////////////////////////////////////
// Item-specific convenience functions
public:
@ -250,6 +263,19 @@ private:
bool mUpdateBaseOrder;
};
// [RLVa:KB] - Checked: 2010-08-31 (RLVa-1.2.1c) | Added: RLVa-1.2.1c
class LLRegisterAttachmentCallback : public LLInventoryCallback
{
public:
LLRegisterAttachmentCallback() {}
/*virtual*/ ~LLRegisterAttachmentCallback() {}
/*virtual*/ void fire(const LLUUID& idItem)
{
LLAppearanceMgr::instance().onRegisterAttachmentComplete(idItem);
}
};
// [/RLVa:KB]
#define SUPPORT_ENSEMBLES 0