summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorDessie Linden <dessie@lindenlab.com>2010-06-28 08:51:26 -0700
committerDessie Linden <dessie@lindenlab.com>2010-06-28 08:51:26 -0700
commit13b0b9319f230b128a808f3886ad589378bca28c (patch)
treecfd70990ca17d47f335905355e1709140e9e2d8a /indra/newview/llinventoryfunctions.cpp
parent6fcc0994dff2bd88256ff8306c8df670df627ef6 (diff)
parent8d18056e8296472d58a820fd77a6a66100e70661 (diff)
Merged from viewer-release
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 37088064c6..7e9a2cb716 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -245,6 +245,47 @@ BOOL get_is_item_worn(const LLUUID& id)
return FALSE;
}
+BOOL get_can_item_be_worn(const LLUUID& id)
+{
+ const LLViewerInventoryItem* item = gInventory.getItem(id);
+ if (!item)
+ return FALSE;
+
+ switch(item->getType())
+ {
+ case LLAssetType::AT_OBJECT:
+ {
+ if (isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(item->getLinkedUUID()))
+ {
+ // Already being worn
+ return FALSE;
+ }
+ else
+ {
+ // Not being worn yet.
+ return TRUE;
+ }
+ break;
+ }
+ case LLAssetType::AT_BODYPART:
+ case LLAssetType::AT_CLOTHING:
+ if(gAgentWearables.isWearingItem(item->getLinkedUUID()))
+ {
+ // Already being worn
+ return FALSE;
+ }
+ else
+ {
+ // Not being worn yet.
+ return TRUE;
+ }
+ break;
+ default:
+ break;
+ }
+ return FALSE;
+}
+
BOOL get_is_item_removable(const LLInventoryModel* model, const LLUUID& id)
{
if (!model)