From 074f4c8c59eebbf109c2846c35cdab05f3997db8 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 8 Sep 2010 13:36:42 -0400 Subject: VWR-22901 FIXED Backwards compatibility for multiattachments Better handling of invalid attachment points. You can now detach points that are incompatible with your viewer, versus having those permanently in the COF> --- indra/newview/llvoavatarself.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index a231afad3f..ec5c95469e 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1163,12 +1163,24 @@ BOOL LLVOAvatarSelf::detachAttachmentIntoInventory(const LLUUID &item_id) gMessageSystem->addUUIDFast(_PREHASH_ItemID, item_id); gMessageSystem->sendReliable(gAgent.getRegion()->getHost()); - // this object might have been selected, so let the selection manager know it's gone now + // This object might have been selected, so let the selection manager know it's gone now LLViewerObject *found_obj = gObjectList.findObject(item_id); if (found_obj) { LLSelectMgr::getInstance()->remove(found_obj); } + + // Error checking in case this object was attached to an invalid point + // In that case, just remove the item from COF preemptively since detach + // will fail. + if (isAgentAvatarValid()) + { + const LLViewerObject *attached_obj = gAgentAvatarp->getWornAttachment(item_id); + if (!attached_obj) + { + LLAppearanceMgr::instance().removeCOFItemLinks(item_id, false); + } + } return TRUE; } return FALSE; -- cgit v1.2.3