diff options
author | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-08-12 15:56:51 +0300 |
---|---|---|
committer | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-08-12 15:56:51 +0300 |
commit | 845317cb360cf095a37d2da11c4f26759b330c60 (patch) | |
tree | 48f96e8b224b494441b21ef714668254e212a1ad | |
parent | 81f727849a9644bef21038663964d97f51564155 (diff) |
EXT-8628 FIXED Crash in LLVOAvatarSelf::getAttachedPointName().
The crash was reproducible only on startup. Apparently, gAgentAvatarp was not valid at that point.
Worked around by checking gAgentAvatarp for being valid.
I didn't investigate what the root cause of the problem was (probably the new multi-attachments implementation), I just needed my viewer to work.
Reviewed by Seraph at https://codereview.productengine.com/secondlife/r/847/.
--HG--
branch : product-engine
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 53622f7188..9bbc6514b4 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3936,7 +3936,7 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) item = (LLViewerInventoryItem*)gInventory.getItem(object_id); if(item && gInventory.isObjectDescendentOf(object_id, gInventory.getRootFolderID())) { - rez_attachment(item, NULL, true); // Replace if "Wear"ing. + rez_attachment(item, NULL); } else if(item && item->isFinished()) { @@ -3952,10 +3952,6 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) } gFocusMgr.setKeyboardFocus(NULL); } - else if ("wear_add" == action) - { - LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, false); // Don't replace if adding. - } else if (isRemoveAction(action)) { LLInventoryItem* item = gInventory.getItem(mUUID); @@ -4007,7 +4003,7 @@ std::string LLObjectBridge::getLabelSuffix() const } } -void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment, bool replace) +void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment) { LLSD payload; payload["item_id"] = item->getLinkedUUID(); // Wear the base object in case this is a link. @@ -4026,14 +4022,9 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach } } - if (!replace) - { - attach_pt |= ATTACHMENT_ADD; - } - payload["attachment_point"] = attach_pt; - if (replace && + if (!gSavedSettings.getBOOL("MultipleAttachments") && (attachment && attachment->getNumObjects() > 0)) { LLNotificationsUtil::add("ReplaceAttachment", LLSD(), payload, confirm_replace_attachment_rez); @@ -4062,6 +4053,8 @@ bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& respon if (itemp) { U8 attachment_pt = notification["payload"]["attachment_point"].asInteger(); + if (gSavedSettings.getBOOL("MultipleAttachments")) + attachment_pt |= ATTACHMENT_ADD; LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_RezSingleAttachmentFromInv); @@ -4118,7 +4111,6 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Wearable And Object Separator")); items.push_back(std::string("Wearable And Object Wear")); - items.push_back(std::string("Wearable Add")); items.push_back(std::string("Attach To")); items.push_back(std::string("Attach To HUD")); // commented out for DEV-32347 @@ -4127,7 +4119,6 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (!gAgentAvatarp->canAttachMoreObjects()) { disabled_items.push_back(std::string("Wearable And Object Wear")); - disabled_items.push_back(std::string("Wearable Add")); disabled_items.push_back(std::string("Attach To")); disabled_items.push_back(std::string("Attach To HUD")); } |