Skip to content

Commit

Permalink
Sorting out InventoryManager
Browse files Browse the repository at this point in the history
  • Loading branch information
cinderblocks committed Nov 16, 2022
1 parent 3f19a2f commit 546cd6f
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions LibreMetaverse/InventoryManager.cs
Expand Up @@ -666,7 +666,9 @@ void FolderUpdatedCB(object sender, FolderUpdatedEventArgs e)

RequestFolderContents(folder, owner, folders, items, order);
if (fetchEvent.WaitOne(timeoutMS, false))
{
objects = _Store.GetContents(folder);
}

FolderUpdated -= FolderUpdatedCB;

Expand All @@ -676,28 +678,24 @@ void FolderUpdatedCB(object sender, FolderUpdatedEventArgs e)
List<UUID> owner_ids = new List<UUID>();
if (objects != null)
{
foreach (InventoryBase o in objects)
foreach (var ob in objects.Where(o => o.GetType() != typeof(InventoryFolder)).Cast<InventoryItem>())
{
if (o.GetType() != typeof(InventoryFolder))
if (ob.IsLink() && !fast_loading)
{
InventoryItem ob = (InventoryItem)o;
if ((ob.IsLink() == true) && (fast_loading == false))
if (Store.Items.ContainsKey(ob.AssetUUID))
{
if (Store.Items.ContainsKey(ob.AssetUUID) == false)
{
load_items.Add(ob.AssetUUID);
owner_ids.Add(Client.Self.AgentID);
}
else
{
cleaned_list.Add(Client.Inventory.FetchItem(ob.AssetUUID, Client.Self.AgentID, 1000 * 5));
}
cleaned_list.Add(Client.Inventory.FetchItem(ob.AssetUUID, Client.Self.AgentID, 1000 * 5));
}
else
{
cleaned_list.Add(ob);
load_items.Add(ob.AssetUUID);
owner_ids.Add(Client.Self.AgentID);
}
}
else
{
cleaned_list.Add(ob);
}
}
}

Expand Down

0 comments on commit 546cd6f

Please sign in to comment.