diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-06-28 12:32:21 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-06-28 12:32:21 -0400 |
commit | 3fca4b0d61ad4534f26a8963ed6381a76e4f7c19 (patch) | |
tree | bd563f39e6bbd5984c4c529bf0252de9b94f2ea5 /indra/newview/llinventoryfunctions.cpp | |
parent | 3ce3df564351ad7b6fb0acd4e0252b5f89f2a47e (diff) | |
parent | 8d18056e8296472d58a820fd77a6a66100e70661 (diff) |
automated merge
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 8940339265..7463658003 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) |