FIRE-15110: RLV @getattach command for "Center 2" attachment point doesn't work:

* Need to omit the legacy attachment point name instead of the current bridge attachment point (Center 2)
* Omit bridge attachment when calling @getattach
Ansariel 2014-12-11 19:23:36 +01:00
parent ec473ef262
commit 0fa86b1587
2 changed files with 11 additions and 5 deletions

View File

@ -77,6 +77,7 @@ public:
void setBridge(LLViewerInventoryItem* item) { mpBridge = item; };
LLViewerInventoryItem* getBridge() { return mpBridge; };
bool canUseBridge();
bool isBridgeValid() const { return NULL != mpBridge; }
void checkBridgeScriptName(const std::string& fileName);
std::string currentFullName() { return mCurrentFullName; }
@ -106,7 +107,6 @@ private:
LLUUID mBridgeUUID;
bool mIsFirstCallDone; //initialization conversation
bool isBridgeValid() const { return NULL != mpBridge; }
uuid_vec_t mAllowedDetachables;

View File

@ -2033,14 +2033,16 @@ ERlvCmdRet RlvHandler::onGetAttach(const RlvCommand& rlvCmd, std::string& strRep
{
const LLViewerJointAttachment* pAttachPt = itAttach->second;
//<FS:TS> FIRE-11848 @getattach includes the LSL bridge
if (pAttachPt->getName() == FS_BRIDGE_ATTACHMENT_POINT_NAME)
if (pAttachPt->getName() == "Bridge")
{
continue;
}
//</FS:TS> FIRE-11848
if ( (0 == idxAttachPt) || (itAttach->first == idxAttachPt) )
{
bool fWorn = (pAttachPt->getNumObjects() > 0) &&
// Ansa: Do not include the bridge when checking for number of objects
S32 bridge_correct = (pAttachPt->getName() == FS_BRIDGE_ATTACHMENT_POINT_NAME && FSLSLBridge::instance().isBridgeValid()) ? 1 : 0;
bool fWorn = ((pAttachPt->getNumObjects() - bridge_correct) > 0) &&
( (!RlvSettings::getHideLockedAttach()) || (RlvForceWear::isForceDetachable(pAttachPt, true, rlvCmd.getObjectID())) );
strReply.push_back( (fWorn) ? '1' : '0' );
}
@ -2064,7 +2066,7 @@ ERlvCmdRet RlvHandler::onGetAttachNames(const RlvCommand& rlvCmd, std::string& s
{
const LLViewerJointAttachment* pAttachPt = itAttach->second;
//<FS:TS> FIRE-11848 @getattach includes the LSL bridge
if (pAttachPt->getName() == FS_BRIDGE_ATTACHMENT_POINT_NAME)
if (pAttachPt->getName() == "Bridge")
{
continue;
}
@ -2075,7 +2077,11 @@ ERlvCmdRet RlvHandler::onGetAttachNames(const RlvCommand& rlvCmd, std::string& s
switch (rlvCmd.getBehaviourType())
{
case RLV_BHVR_GETATTACHNAMES: // Every attachment point that has an attached object
fAdd = (pAttachPt->getNumObjects() > 0);
// Ansa: Do not include the bridge when checking for number of objects
{
S32 bridge_correct = ((pAttachPt->getName() == FS_BRIDGE_ATTACHMENT_POINT_NAME && FSLSLBridge::instance().isBridgeValid()) ? 1 : 0);
fAdd = ((pAttachPt->getNumObjects() - bridge_correct) > 0);
}
break;
case RLV_BHVR_GETADDATTACHNAMES: // Every attachment point that can be attached to (wear replace OR wear add)
fAdd = (gRlvAttachmentLocks.canAttach(pAttachPt) & RLV_WEAR);