EXT-3527 : Centralize calls to getIsItemWorn

Changed more functions to use get_is_item_worn.

--HG--
branch : avatar-pipeline
master
Loren Shih 2009-12-16 17:02:02 -05:00
parent 7796fc6748
commit 95bbee6b0e
2 changed files with 6 additions and 36 deletions

View File

@ -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 (get_is_item_worn(item->getUUID()))
{
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( 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 )

View File

@ -109,7 +109,7 @@ LLUIImagePtr get_item_icon(LLAssetType::EType asset_type,
U32 attachment_point,
BOOL item_is_multi );
// Is it worn, attached, etc...
// Is this item or its baseitem is worn, attached, etc...
BOOL get_is_item_worn(const LLUUID& id);
#endif // LL_LLINVENTORYFUNCTIONS_H