RLVa 1.1.2 to 1.1.3 upgrade. InvLinks + COF
This commit is contained in:
@@ -207,7 +207,8 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
|
||||
mJointInfo(NULL),
|
||||
mState(0),
|
||||
mMedia(NULL),
|
||||
mClickAction(0)
|
||||
mClickAction(0),
|
||||
mAttachmentItemID(LLUUID::null)
|
||||
{
|
||||
if(!is_global)
|
||||
{
|
||||
@@ -508,9 +509,20 @@ BOOL LLViewerObject::isOverGroupOwnedLand() const
|
||||
&& mRegionp->getParcelOverlay()->isOwnedGroup(getPositionRegion());
|
||||
}
|
||||
|
||||
void LLViewerObject::setParent(LLViewerObject* parent)
|
||||
BOOL LLViewerObject::setParent(LLViewerObject* parent)
|
||||
{
|
||||
LLPrimitive::setParent(parent);
|
||||
if (mParent != parent)
|
||||
{
|
||||
LLViewerObject* old_parent = (LLViewerObject*)mParent ;
|
||||
BOOL ret = LLPrimitive::setParent(parent);
|
||||
if (ret && old_parent && parent)
|
||||
{
|
||||
old_parent->removeChild(this) ;
|
||||
}
|
||||
return ret ;
|
||||
}
|
||||
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
void LLViewerObject::addChild(LLViewerObject *childp)
|
||||
@@ -529,8 +541,10 @@ void LLViewerObject::addChild(LLViewerObject *childp)
|
||||
childp->mbCanSelect = mbCanSelect;
|
||||
}
|
||||
|
||||
childp->setParent(this);
|
||||
mChildList.push_back(childp);
|
||||
if (childp->setParent(this))
|
||||
{
|
||||
mChildList.push_back(childp);
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerObject::removeChild(LLViewerObject *childp)
|
||||
@@ -627,11 +641,15 @@ BOOL LLViewerObject::setDrawableParent(LLDrawable* parentp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL ret = mDrawable->mXform.setParent(parentp ? &parentp->mXform : NULL);
|
||||
if (!ret)
|
||||
{
|
||||
return FALSE ;
|
||||
}
|
||||
LLDrawable* old_parent = mDrawable->mParent;
|
||||
|
||||
mDrawable->mParent = parentp;
|
||||
|
||||
BOOL ret = mDrawable->mXform.setParent(parentp ? &parentp->mXform : NULL);
|
||||
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
|
||||
if( (old_parent != parentp && old_parent)
|
||||
|| (parentp && parentp->isActive()))
|
||||
@@ -1621,20 +1639,21 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
gObjectList.killObject(this);
|
||||
return retval;
|
||||
}
|
||||
// [RLVa:KB] - Checked: 2009-12-27 (RLVa-1.1.0k) | Added: RLVa-1.1.0k
|
||||
// [RLVa:KB] - Checked: 2010-03-16 (RLVa-1.1.0k) | Added: RLVa-1.1.0k
|
||||
if ( (rlv_handler_t::isEnabled()) && (sent_parentp->isAvatar()) && (sent_parentp->getID() == gAgent.getID()) )
|
||||
{
|
||||
// Rezzed object that's being worn as an attachment (we're assuming this will be due to llAttachToAvatar())
|
||||
S32 idxAttachPt = ATTACHMENT_ID_FROM_STATE(getState());
|
||||
if (gRlvHandler.isLockedAttachment(idxAttachPt, RLV_LOCK_ANY))
|
||||
if (gRlvAttachmentLocks.isLockedAttachmentPoint(idxAttachPt, RLV_LOCK_ADD))
|
||||
{
|
||||
// If this will end up on an "add locked" attachment point then treat the attach as a user action
|
||||
LLNameValue* nvItem = getNVPair("AttachItemID");
|
||||
if (nvItem)
|
||||
{
|
||||
LLUUID idItem(nvItem->getString());
|
||||
// URGENT-RLVa: [RLVa-1.2.0] At the moment llAttachToAvatar always seems to *add*
|
||||
if (idItem.notNull())
|
||||
gRlvHandler.onWearAttachment(idItem);
|
||||
RlvAttachmentLockWatchdog::instance().onWearAttachment(idItem, RLV_WEAR_ADD);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5214,3 +5233,21 @@ std::string LLViewerObject::getAttachmentPointName()
|
||||
return llformat("unsupported point %d", point);
|
||||
}
|
||||
// </edit>
|
||||
|
||||
|
||||
const LLUUID &LLViewerObject::extractAttachmentItemID()
|
||||
{
|
||||
LLUUID item_id = LLUUID::null;
|
||||
LLNameValue* item_id_nv = getNVPair("AttachItemID");
|
||||
if (item_id_nv)
|
||||
{
|
||||
const char* s = item_id_nv->getString();
|
||||
if (s)
|
||||
{
|
||||
item_id.set(s);
|
||||
}
|
||||
}
|
||||
setAttachmentItemID(item_id);
|
||||
return getAttachmentItemID();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user