summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2009-12-18 13:52:05 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2009-12-18 13:52:05 +0200
commit2a49de3befff5e2b48a273f70a21f525b50a189c (patch)
treed96f3ceaa848345e1857e71a1a12cd0ba0f6c4bf /indra/newview/llinventoryfunctions.cpp
parent688e66fe299ba4f4afe080d907a4eff9cc77f6dd (diff)
parentad65fa11acdf7f655f32e6ca43b2f2bc997ef1e6 (diff)
Merge from default branch.
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 75218e98e0..8f4136c01f 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -338,3 +338,33 @@ LLUIImagePtr get_item_icon(LLAssetType::EType asset_type,
const std::string& icon_name = get_item_icon_name(asset_type, inventory_type, attachment_point, item_is_multi );
return LLUI::getUIImage(icon_name);
}
+
+BOOL get_is_item_worn(const LLUUID& id)
+{
+ const LLViewerInventoryItem* item = gInventory.getItem(id);
+ if (!item)
+ return FALSE;
+
+ switch(item->getType())
+ {
+ case LLAssetType::AT_OBJECT:
+ {
+ const LLVOAvatarSelf* my_avatar = gAgent.getAvatarObject();
+ if(my_avatar && my_avatar->isWearingAttachment(item->getLinkedUUID()))
+ return TRUE;
+ break;
+ }
+ case LLAssetType::AT_BODYPART:
+ case LLAssetType::AT_CLOTHING:
+ if(gAgentWearables.isWearingItem(item->getLinkedUUID()))
+ return TRUE;
+ break;
+ case LLAssetType::AT_GESTURE:
+ if (LLGestureManager::instance().isGestureActive(item->getLinkedUUID()))
+ return TRUE;
+ break;
+ default:
+ break;
+ }
+ return FALSE;
+}