summaryrefslogtreecommitdiff
path: root/indra/newview/llwearablelist.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-06-24 21:36:42 +0000
committerLoren Shih <seraph@lindenlab.com>2009-06-24 21:36:42 +0000
commita00af78b95a62c613f9a2ac4a28a0017086c5ffa (patch)
tree25c46a6508a77d9b250fe166d7b0692983dc98f2 /indra/newview/llwearablelist.cpp
parent2ce76c7ed47b49f8a7bafe69bdea064189e1ccbd (diff)
merge -r125267:125272 svn+ssh://svn.lindenlab.com/svn/linden/branches/avatar-pipeline/inventory-links__merge__viewer2.0.0-3-r125202 to svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3
Diffstat (limited to 'indra/newview/llwearablelist.cpp')
-rw-r--r--indra/newview/llwearablelist.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp
index 92de94636b..1275312676 100644
--- a/indra/newview/llwearablelist.cpp
+++ b/indra/newview/llwearablelist.cpp
@@ -77,14 +77,17 @@ LLWearableList::~LLWearableList()
void LLWearableList::getAsset(const LLAssetID& _assetID, const std::string& wearable_name, LLAssetType::EType asset_type, void(*asset_arrived_callback)(LLWearable*, void* userdata), void* userdata)
{
LLAssetID assetID = _assetID;
- if (asset_type == LLAssetType::AT_LINK)
+
+ // A bit of a hack since wearables database doesn't contain asset types...
+ // Perform indirection in case this assetID is in fact a link. This only works
+ // because of the assumption that all assetIDs and itemIDs are unique (i.e.
+ // no assetID is also used as an itemID elsewhere); therefore if the assetID
+ // exists as an itemID in the user's inventory, then this must be a link.
+ const LLInventoryItem *linked_item = gInventory.getItem(_assetID);
+ if (linked_item)
{
- LLInventoryItem *linked_item = gInventory.getItem(_assetID);
- if (linked_item)
- {
- assetID = linked_item->getAssetUUID();
- asset_type = linked_item->getType();
- }
+ assetID = linked_item->getAssetUUID();
+ asset_type = linked_item->getType();
}
llassert( (asset_type == LLAssetType::AT_CLOTHING) || (asset_type == LLAssetType::AT_BODYPART) );
LLWearable* instance = get_if_there(mList, assetID, (LLWearable*)NULL );