summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-12-05 21:44:43 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-12-05 21:44:43 +0200
commit691993dc53a0d2299fbf024cceee4ece5e44555b (patch)
treefeea1a19709efc48010c8ea36e343e6591f16299
parentff002e65f85aa8613cc9a49bd2ec68a754defd70 (diff)
SL-12269 Unknown asset types are matched in inventory search for specific types
-rw-r--r--indra/newview/llinventoryfilter.cpp79
1 files changed, 53 insertions, 26 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index e8bc915f22..e200b5bc9e 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -286,21 +286,34 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent
// Pass if this item's type is of the correct filter type
if (filterTypes & FILTERTYPE_OBJECT)
{
-
- // If it has no type, pass it, unless it's a link.
- if (object_type == LLInventoryType::IT_NONE)
- {
- if (object && object->getIsLinkType())
- {
- return FALSE;
- }
- }
- else if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0))
- {
- return FALSE;
- }
+ switch (object_type)
+ {
+ case LLInventoryType::IT_NONE:
+ // If it has no type, pass it, unless it's a link.
+ if (object && object->getIsLinkType())
+ {
+ return FALSE;
+ }
+ break;
+ case LLInventoryType::IT_UNKNOWN:
+ {
+ // Unknows are only shown when we show every type.
+ // Unknows are 255 and won't fit in 64 bits.
+ if (mFilterOps.mFilterObjectTypes != 0xffffffffffffffffULL)
+ {
+ return FALSE;
+ }
+ break;
+ }
+ default:
+ if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0))
+ {
+ return FALSE;
+ }
+ break;
+ }
}
-
+
if(filterTypes & FILTERTYPE_WORN)
{
if (!get_is_item_worn(object_id))
@@ -411,18 +424,32 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLInventoryItem* item) cons
// Pass if this item's type is of the correct filter type
if (filterTypes & FILTERTYPE_OBJECT)
{
- // If it has no type, pass it, unless it's a link.
- if (object_type == LLInventoryType::IT_NONE)
- {
- if (item && item->getIsLinkType())
- {
- return false;
- }
- }
- else if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0))
- {
- return false;
- }
+ switch (object_type)
+ {
+ case LLInventoryType::IT_NONE:
+ // If it has no type, pass it, unless it's a link.
+ if (item && item->getIsLinkType())
+ {
+ return FALSE;
+ }
+ break;
+ case LLInventoryType::IT_UNKNOWN:
+ {
+ // Unknows are only shown when we show every type.
+ // Unknows are 255 and won't fit in 64 bits.
+ if (mFilterOps.mFilterObjectTypes != 0xffffffffffffffffULL)
+ {
+ return FALSE;
+ }
+ break;
+ }
+ default:
+ if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0))
+ {
+ return FALSE;
+ }
+ break;
+ }
}
////////////////////////////////////////////////////////////////////////////////