summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatarself.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2010-09-10 11:51:55 -0700
committerMerov Linden <merov@lindenlab.com>2010-09-10 11:51:55 -0700
commit807aec7bafe19fca75a8f3980bd621fad7c8338e (patch)
treef2e120963ff103524ef6206506c1ee9e0bdd3a2d /indra/newview/llvoavatarself.cpp
parent19026c621e338040df59adabdf7055924271f66d (diff)
parent1f46b1d87bf4664e62131e7823ab5a7fcafe4b73 (diff)
Pull from lindenlab/viewer-development
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
-rw-r--r--indra/newview/llvoavatarself.cpp14
1 files changed, 13 insertions, 1 deletions
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;