check for asset
parent
22b1a38318
commit
c8b69f712f
|
@ -86,6 +86,17 @@ namespace OpenSim.Modules.TextureFetcher
|
|||
return false;
|
||||
}
|
||||
|
||||
private bool isAssetInInventory(SceneObjectPart part, UUID assetID)
|
||||
{
|
||||
List<TaskInventoryItem> inventarContend = part.Inventory.GetInventoryItems();
|
||||
|
||||
foreach (TaskInventoryItem item in inventarContend)
|
||||
if (item.AssetID == assetID)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void copyTexturesToInventory(SceneObjectPart part)
|
||||
{
|
||||
if (part.ParentGroup.IsAttachment)
|
||||
|
@ -123,11 +134,10 @@ namespace OpenSim.Modules.TextureFetcher
|
|||
}
|
||||
|
||||
//Check if the item is allready in the inventory and then add it.
|
||||
List<UUID> inventarContend = part.Inventory.GetInventoryList();
|
||||
bool updateNeeded = false;
|
||||
foreach (TaskInventoryItem item in inventoryItems)
|
||||
{
|
||||
if(!inventarContend.Contains(item.AssetID))
|
||||
if(!isAssetInInventory(part, item.AssetID))
|
||||
{
|
||||
updateNeeded = true;
|
||||
part.Inventory.AddInventoryItem(item, false);
|
||||
|
|
Loading…
Reference in New Issue