EXT-3266 : Object contents show up as empty always

InventoryFilter was rejecting all items that didn't exist in agent inventory.  Changed this to properly account for inventory of in-world objects.

--HG--
branch : avatar-pipeline
meow-7.2.2
Loren Shih 2009-12-08 17:25:31 -05:00
parent bfdfec637c
commit f7c883be9a
1 changed files with 10 additions and 4 deletions

View File

@ -115,8 +115,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item)
const LLUUID object_id = listener->getUUID();
const LLInventoryObject *object = gInventory.getObject(object_id);
if (!object) return FALSE;
const U32 filterTypes = mFilterOps.mFilterTypes;
////////////////////////////////////////////////////////////////////////////////
@ -127,11 +125,13 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item)
// If it has no type, pass it, unless it's a link.
if (object_type == LLInventoryType::IT_NONE)
{
if (object->getIsLinkType())
if (object && object->getIsLinkType())
return FALSE;
}
if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0))
else if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0))
{
return FALSE;
}
}
//
////////////////////////////////////////////////////////////////////////////////
@ -143,6 +143,10 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item)
// if its parent is a category of the filter type.
if (filterTypes & FILTERTYPE_CATEGORY)
{
// Can only filter categories for items in your inventory
// (e.g. versus in-world object contents).
if (!object) return FALSE;
LLUUID cat_id = object_id;
if (listener->getInventoryType() != LLInventoryType::IT_CATEGORY)
{
@ -163,6 +167,8 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item)
// Pass if this item is the target UUID or if it links to the target UUID
if (filterTypes & FILTERTYPE_UUID)
{
if (!object) return FALSE;
if (object->getLinkedUUID() != mFilterOps.mFilterUUID)
return FALSE;
}