From 51f740ca8d0e947d8fde38cb353bdf753cd224fa Mon Sep 17 00:00:00 2001 From: callum Date: Fri, 6 Jul 2012 11:31:37 -0700 Subject: MAINT-1228 FIX Can not put more than one object into the contents of an object Reviewed by Paul PE --- indra/newview/llviewerobject.cpp | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 72fd3c1a4a..67c87a6c63 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2924,27 +2924,39 @@ void LLViewerObject::removeInventory(const LLUUID& item_id) ++mInventorySerialNum; } -void LLViewerObject::updateInventory( - LLViewerInventoryItem* item, - U8 key, - bool is_new) +bool LLViewerObject::isTextureInInventory(LLViewerInventoryItem* item) { - LLMemType mt(LLMemType::MTYPE_OBJECT); + bool result = false; - std::list::iterator begin = mPendingInventoryItemsIDs.begin(); - std::list::iterator end = mPendingInventoryItemsIDs.end(); + if (item && LLAssetType::AT_TEXTURE == item->getType()) + { + std::list::iterator begin = mPendingInventoryItemsIDs.begin(); + std::list::iterator end = mPendingInventoryItemsIDs.end(); - bool is_fetching = std::find(begin, end, item->getAssetUUID()) != end; - bool is_fetched = getInventoryItemByAsset(item->getAssetUUID()) != NULL; + bool is_fetching = std::find(begin, end, item->getAssetUUID()) != end; + bool is_fetched = getInventoryItemByAsset(item->getAssetUUID()) != NULL; - if (is_fetched || is_fetching) - { - return; + result = is_fetched || is_fetching; } - else + + return result; +} + +void LLViewerObject::updateTextureInventory(LLViewerInventoryItem* item, U8 key, bool is_new) +{ + if (item && !isTextureInInventory(item)) { mPendingInventoryItemsIDs.push_back(item->getAssetUUID()); + updateInventory(item, key, is_new); } +} + +void LLViewerObject::updateInventory( + LLViewerInventoryItem* item, + U8 key, + bool is_new) +{ + LLMemType mt(LLMemType::MTYPE_OBJECT); // This slices the object into what we're concerned about on the // viewer. The simulator will take the permissions and transfer -- cgit v1.2.3