diff options
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 14 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 2 |
3 files changed, 21 insertions, 9 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 78b5c10748..ab75b9ef8d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3979,22 +3979,22 @@ std::string LLObjectBridge::getLabelSuffix() const { if (get_is_item_worn(mUUID)) { - if (!isAgentAvatarValid()) + if (!isAgentAvatarValid()) // Error condition, can't figure out attach point { return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn"); } - std::string attachment_point_name = gAgentAvatarp->getAttachedPointName(mUUID); - + if (attachment_point_name == LLStringUtil::null) // Error condition, invalid attach point + { + attachment_point_name = "Invalid Attachment"; + } // e.g. "(worn on ...)" / "(attached to ...)" LLStringUtil::format_map_t args; args["[ATTACHMENT_POINT]"] = LLTrans::getString(attachment_point_name); + return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args); } - else - { - return LLItemBridge::getLabelSuffix(); - } + return LLItemBridge::getLabelSuffix(); } void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment, bool replace) diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index a231afad3f..ec5c95469e 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1163,12 +1163,24 @@ BOOL LLVOAvatarSelf::detachAttachmentIntoInventory(const LLUUID &item_id) gMessageSystem->addUUIDFast(_PREHASH_ItemID, item_id); gMessageSystem->sendReliable(gAgent.getRegion()->getHost()); - // this object might have been selected, so let the selection manager know it's gone now + // This object might have been selected, so let the selection manager know it's gone now LLViewerObject *found_obj = gObjectList.findObject(item_id); if (found_obj) { LLSelectMgr::getInstance()->remove(found_obj); } + + // Error checking in case this object was attached to an invalid point + // In that case, just remove the item from COF preemptively since detach + // will fail. + if (isAgentAvatarValid()) + { + const LLViewerObject *attached_obj = gAgentAvatarp->getWornAttachment(item_id); + if (!attached_obj) + { + LLAppearanceMgr::instance().removeCOFItemLinks(item_id, false); + } + } return TRUE; } return FALSE; diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index cf040b10c7..72639f08ee 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2019,6 +2019,7 @@ Clears (deletes) the media and all params from the given face. <string name="Stomach">Stomach</string> <string name="Left Pec">Left Pec</string> <string name="Right Pec">Right Pec</string> + <string name="Invalid Attachment">Invalid Attachment Point</string> <!-- Avatar age computation, see LLDateUtil::ageFromDate --> <string name="YearsMonthsOld">[AGEYEARS] [AGEMONTHS] old</string> @@ -2182,7 +2183,6 @@ Clears (deletes) the media and all params from the given face. <string name="ATTACH_HUD_BOTTOM_LEFT">HUD Bottom Left</string> <string name="ATTACH_HUD_BOTTOM">HUD Bottom</string> <string name="ATTACH_HUD_BOTTOM_RIGHT">HUD Bottom Right</string> - <string name="Bad attachment point">Invalid Attachment Point</string> <!-- script editor --> <string name="CursorPos">Line [LINE], Column [COLUMN]</string> |