diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-09-21 23:47:08 +0300 | 
|---|---|---|
| committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-09-21 23:47:08 +0300 | 
| commit | 34444a08738d836274337253fadcc945d13b1fa5 (patch) | |
| tree | 5e1959bff7fe6a0c4a5ed0ee91493efd472ca0f2 /indra | |
| parent | a1c215aa200840ebeed61ed7249c7f84620d9709 (diff) | |
SL-13697 Items I am wearing continue to go to lost and found
Contribution from Ansariel Hiller
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llinventorymodel.cpp | 33 | 
1 files changed, 23 insertions, 10 deletions
| diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index b37ebde4ec..543db806d4 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -946,16 +946,29 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item, U32 mask)  		LLUUID new_parent_id = item->getParentUUID();  		bool update_parent_on_server = false; -		if (new_parent_id.isNull()) -		{ -			// item with null parent will end in random location and then in Lost&Found, -			// either move to default folder as if it is new item or don't move at all -			LL_WARNS(LOG_INV) << "Update attempts to reparent item " << item->getUUID() -				<< " to null folder. Moving to Lost&Found. Old item name: " << old_item->getName() -				<< ". New name: " << item->getName() -				<< "." << LL_ENDL; -			new_parent_id = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); -			update_parent_on_server = true; +		if (new_parent_id.isNull() && !LLApp::isExiting()) +		{ +            if (old_parent_id.isNull()) +            { +                // Item with null parent will end in random location and then in Lost&Found, +                // either move to default folder as if it is new item or don't move at all +                LL_WARNS(LOG_INV) << "Update attempts to reparent item " << item->getUUID() +                                  << " to null folder. Moving to Lost&Found. Old item name: " << old_item->getName() +                                  << ". New name: " << item->getName() +                                  << "." << LL_ENDL; +                new_parent_id = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); +                update_parent_on_server = true; +            }
 +            else
 +            {
 +                // Probably not the best way to handle this, we might encounter real case of 'lost&found' at some point
 +                LL_WARNS(LOG_INV) << "Update attempts to reparent item " << item->getUUID()
 +                                  << " to null folder. Old parent not null. Moving to old parent. Old item name: " << old_item->getName()
 +                                  << ". New name: " << item->getName()
 +                                  << "." << LL_ENDL;
 +                new_parent_id = old_parent_id;
 +                update_parent_on_server = true;
 +            }  		}  		if(old_parent_id != new_parent_id) | 
