diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2014-10-23 06:20:10 -0400 |
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2014-10-23 06:20:10 -0400 |
| commit | b99d57fbdeda3f012e090bb610f9d3fb44f4248f (patch) | |
| tree | 52e674e2757374c6e60675b29c878f400714b813 /indra/newview/llvoavatarself.cpp | |
| parent | 920b6de4b1b2234b356258dc7ea1fb108d648cea (diff) | |
MAINT-4196 WIP, including clearer inventory warnings for attachment errors
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
| -rwxr-xr-x | indra/newview/llvoavatarself.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 42a7c2e576..ccc30c448d 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1093,9 +1093,19 @@ LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id) return NULL; } -const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id) const +bool LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const { + if (!gInventory.getItem(inv_item_id)) + { + name = "ATTACHMENT_MISSING_ITEM"; + return false; + } const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id); + if (!gInventory.getItem(base_inv_item_id)) + { + name = "ATTACHMENT_MISSING_BASE_ITEM"; + return false; + } for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) @@ -1103,11 +1113,13 @@ const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id const LLViewerJointAttachment* attachment = iter->second; if (attachment->getAttachedObject(base_inv_item_id)) { - return attachment->getName(); + name = attachment->getName(); + return true; } } - return LLStringUtil::null; + name = "ATTACHMENT_NOT_ATTACHED"; + return false; } //virtual |
