check if textures are exists

master
Christopher 2020-06-28 15:50:30 +02:00
parent 9b32355f91
commit c65e4e4702
1 changed files with 11 additions and 0 deletions

View File

@ -135,6 +135,16 @@ namespace OpenSim.Modules.TextureFetcher
allTextures.Add(face.TextureID); allTextures.Add(face.TextureID);
} }
//Remove not existing textures
String[] _assetIDs = new string[allTextures.Count];
for (int i = 0; i < allTextures.Count; i++)
_assetIDs[i] = allTextures[i].ToString();
bool[] existing = m_scene.AssetService.AssetsExist(_assetIDs);
for (int i = 0; i < existing.Length; i++)
if (existing[i] == false)
allTextures[i] = UUID.Zero;
//Convert texture uuid list to inventar items. //Convert texture uuid list to inventar items.
foreach (UUID texture in allTextures) foreach (UUID texture in allTextures)
{ {
@ -166,6 +176,7 @@ namespace OpenSim.Modules.TextureFetcher
if (!isAssetInInventory(part, item.AssetID)) if (!isAssetInInventory(part, item.AssetID))
{ {
updateNeeded = true; updateNeeded = true;
part.ParentGroup.RootPart.Inventory.AddInventoryItem(item, false); part.ParentGroup.RootPart.Inventory.AddInventoryItem(item, false);
} }
} }