diff options
Diffstat (limited to 'indra/newview/llwearablelist.cpp')
-rw-r--r-- | indra/newview/llwearablelist.cpp | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 1275312676..da62223aac 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -74,21 +74,8 @@ LLWearableList::~LLWearableList() mList.clear(); } -void LLWearableList::getAsset(const LLAssetID& _assetID, const std::string& wearable_name, LLAssetType::EType asset_type, void(*asset_arrived_callback)(LLWearable*, void* userdata), void* userdata) +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; - - // 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) - { - 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 ); if( instance ) @@ -218,38 +205,19 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID } -LLWearable* LLWearableList::createCopyFromAvatar(const LLWearable* old_wearable, const std::string& new_name) -{ - lldebugs << "LLWearableList::createCopyFromAvatar()" << llendl; - - LLWearable *wearable = generateNewWearable(); - wearable->copyDataFrom( old_wearable ); - - LLPermissions perm(old_wearable->getPermissions()); - perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true); - wearable->setPermissions(perm); - wearable->readFromAvatar(); // update from the avatar - - if (!new_name.empty()) wearable->setName(new_name); - - // Send to the dataserver - wearable->saveNewAsset(); - - return wearable; -} - - -LLWearable* LLWearableList::createCopy(const LLWearable* old_wearable) +LLWearable* LLWearableList::createCopy(const LLWearable* old_wearable, const std::string& new_name) { lldebugs << "LLWearableList::createCopy()" << llendl; LLWearable *wearable = generateNewWearable(); wearable->copyDataFrom(old_wearable); - + LLPermissions perm(old_wearable->getPermissions()); perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true); wearable->setPermissions(perm); + if (!new_name.empty()) wearable->setName(new_name); + // Send to the dataserver wearable->saveNewAsset(); @@ -273,7 +241,6 @@ LLWearable* LLWearableList::createNewWearable( EWearableType type ) wearable->setPermissions(perm); // Description and sale info have default values. - wearable->setParamsToDefaults(); wearable->setTexturesToDefaults(); |