summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-12-16 17:02:02 -0500
committerLoren Shih <seraph@lindenlab.com>2009-12-16 17:02:02 -0500
commit95bbee6b0e2016ea22de6ed439210bc6faf0f77d (patch)
tree6b71afd21527da830c929322a103ed6391f1dee4 /indra/newview/llinventorybridge.cpp
parent7796fc674802fa217791f3229c4166eb8b0e6138 (diff)
EXT-3527 : Centralize calls to getIsItemWorn
Changed more functions to use get_is_item_worn. --HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp40
1 files changed, 5 insertions, 35 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index d176484389..bc0bf7fdf4 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -190,12 +190,7 @@ BOOL LLInvFVBridge::isItemRemovable()
{
return TRUE;
}
- if (gAgentWearables.isWearingItem(mUUID))
- {
- return FALSE;
- }
- const LLVOAvatarSelf* avatar = gAgent.getAvatarObject();
- if (avatar && avatar->isWearingAttachment(mUUID))
+ if (get_is_item_worn(mUUID))
{
return FALSE;
}
@@ -1659,23 +1654,10 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
for( i = 0; i < descendent_items.count(); i++ )
{
LLInventoryItem* item = descendent_items[i];
- if( (item->getType() == LLAssetType::AT_CLOTHING) ||
- (item->getType() == LLAssetType::AT_BODYPART) )
- {
- if( gAgentWearables.isWearingItem( item->getUUID() ) )
- {
- is_movable = FALSE; // It's generally movable, but not into the trash!
- break;
- }
- }
- else
- if( item->getType() == LLAssetType::AT_OBJECT )
+ if (get_is_item_worn(item->getUUID()))
{
- if( avatar->isWearingAttachment( item->getUUID() ) )
- {
- is_movable = FALSE; // It's generally movable, but not into the trash!
- break;
- }
+ is_movable = FALSE;
+ break; // It's generally movable, but not into the trash!
}
}
}
@@ -2955,19 +2937,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
if(is_movable && move_is_into_trash)
{
- switch(inv_item->getType())
- {
- case LLAssetType::AT_CLOTHING:
- case LLAssetType::AT_BODYPART:
- is_movable = !gAgentWearables.isWearingItem(inv_item->getUUID());
- break;
-
- case LLAssetType::AT_OBJECT:
- is_movable = !avatar->isWearingAttachment(inv_item->getUUID());
- break;
- default:
- break;
- }
+ is_movable = inv_item->getIsLinkType() || !get_is_item_worn(inv_item->getUUID());
}
if ( is_movable )