summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerjointattachment.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-02-01 02:23:35 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-02-01 02:23:35 +0000
commitb302f15deea0f4f7f5de75bfd3776c17021b6444 (patch)
tree7a2842445c8dd6c8537bd9f8d4d171e95b85a845 /indra/newview/llviewerjointattachment.cpp
parent6ae0a9e2c1ac51385c341ff4a93384950e2e7e40 (diff)
EFFECTIVE MERGE: maint-viewer-3 -r 77368:77381 -> release
ACTUAL MERGE: merge maint-viewer-3-merge -r 79051 -> release
Diffstat (limited to 'indra/newview/llviewerjointattachment.cpp')
-rw-r--r--indra/newview/llviewerjointattachment.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp
index 186b141ff9..18c99f7453 100644
--- a/indra/newview/llviewerjointattachment.cpp
+++ b/indra/newview/llviewerjointattachment.cpp
@@ -174,7 +174,20 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
if (mAttachedObject)
{
llwarns << "Attempted to attach object where an attachment already exists!" << llendl;
- return FALSE;
+
+ if (mAttachedObject == object) {
+ llinfos << "(same object re-attached)" << llendl;
+ removeObject(mAttachedObject);
+ // Pass through anyway to let setupDrawable()
+ // re-connect object to the joint correctly
+ }
+ else {
+ llinfos << "(objects differ, removing existing object)" << llendl;
+ // Rather hacky, but no-one can think of something
+ // better to do for this case.
+ gObjectList.killObject(mAttachedObject);
+ // Proceed with new object attachment
+ }
}
mAttachedObject = object;