diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-08-13 14:33:30 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-08-13 14:33:30 -0400 |
commit | 37a0124bfdedfd24c31f40c250e65ad42be0e6de (patch) | |
tree | 7efea4754ff53a3065ff76d6fbeb4a57e025bdc4 /indra/newview/llinventorybridge.cpp | |
parent | 6c1796c105054bf52f879ab7060a2f53f896d44d (diff) |
DEV-52580 FIX
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 38f3521b2d..531d4c3ee9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4000,8 +4000,17 @@ std::string LLObjectBridge::getLabelSuffix() const void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment) { - LLSD payload; - payload["item_id"] = item->getLinkedUUID(); // Wear the base object in case this is a link. + const LLUUID& item_id = item->getLinkedUUID(); + + // Check for duplicate request. + if (isAgentAvatarValid() && + (gAgentAvatarp->attachmentWasRequested(item_id) || + gAgentAvatarp->isWearingAttachment(item_id))) + { + llwarns << "duplicate attachment request, ignoring" << llendl; + return; + } + gAgentAvatarp->addAttachmentRequest(item_id); S32 attach_pt = 0; if (isAgentAvatarValid() && attachment) @@ -4017,6 +4026,8 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach } } + LLSD payload; + payload["item_id"] = item_id; // Wear the base object in case this is a link. payload["attachment_point"] = attach_pt; if (!gSavedSettings.getBOOL("MultipleAttachments") && @@ -4043,11 +4054,13 @@ bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& respon S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0/*YES*/) { - LLViewerInventoryItem* itemp = gInventory.getItem(notification["payload"]["item_id"].asUUID()); + LLUUID item_id = notification["payload"]["item_id"].asUUID(); + LLViewerInventoryItem* itemp = gInventory.getItem(item_id); if (itemp) { U8 attachment_pt = notification["payload"]["attachment_point"].asInteger(); + if (gSavedSettings.getBOOL("MultipleAttachments")) attachment_pt |= ATTACHMENT_ADD; |