Yet another attempt to solve Issue 929, bridge autodetach
This time we go through with the bridge attach but we setup a callback to detach once attachment process has gone through
This commit is contained in:
@@ -6191,6 +6191,17 @@ void LLVOAvatar::removeChild(LLViewerObject *childp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
boost::signals2::connection sDetachBridgeConnection;
|
||||||
|
void detach_bridge(const LLViewerObject* obj, const LLViewerObject* bridge)
|
||||||
|
{
|
||||||
|
if (obj != bridge) return;
|
||||||
|
sDetachBridgeConnection.disconnect();
|
||||||
|
LLVOAvatarSelf::detachAttachmentIntoInventory(obj->getAttachmentItemID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* viewer_object)
|
LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* viewer_object)
|
||||||
{
|
{
|
||||||
S32 attachmentID = ATTACHMENT_ID_FROM_STATE(viewer_object->getState());
|
S32 attachmentID = ATTACHMENT_ID_FROM_STATE(viewer_object->getState());
|
||||||
@@ -6211,8 +6222,7 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi
|
|||||||
if (isSelf() && attachmentID == 127 && gSavedSettings.getBOOL("SGDetachBridge"))
|
if (isSelf() && attachmentID == 127 && gSavedSettings.getBOOL("SGDetachBridge"))
|
||||||
{
|
{
|
||||||
llinfos << "Bridge detected! detaching" << llendl;
|
llinfos << "Bridge detected! detaching" << llendl;
|
||||||
LLVOAvatarSelf::detachAttachmentIntoInventory(viewer_object->getAttachmentItemID());
|
sDetachBridgeConnection = gAgentAvatarp->setAttachmentCallback(boost::bind(detach_bridge, _1, viewer_object));
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
// attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest)
|
// attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest)
|
||||||
// [SL:KB] - Patch: Appearance-LegacyMultiAttachment | Checked: 2010-08-28 (Catznip-2.2.0a) | Added: Catznip2.1.2a
|
// [SL:KB] - Patch: Appearance-LegacyMultiAttachment | Checked: 2010-08-28 (Catznip-2.2.0a) | Added: Catznip2.1.2a
|
||||||
|
|||||||
Reference in New Issue
Block a user