diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-12-16 17:02:02 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-12-16 17:02:02 -0500 |
commit | 95bbee6b0e2016ea22de6ed439210bc6faf0f77d (patch) | |
tree | 6b71afd21527da830c929322a103ed6391f1dee4 /indra | |
parent | 7796fc674802fa217791f3229c4166eb8b0e6138 (diff) |
EXT-3527 : Centralize calls to getIsItemWorn
Changed more functions to use get_is_item_worn.
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 40 | ||||
-rw-r--r-- | indra/newview/llinventoryfunctions.h | 2 |
2 files changed, 6 insertions, 36 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 ) diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 1ff1b9a066..968db84819 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -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 |