From c65e4e4702ad4c12f1ed2a3797dd3bc414b17762 Mon Sep 17 00:00:00 2001 From: Christopher Date: Sun, 28 Jun 2020 15:50:30 +0200 Subject: [PATCH] check if textures are exists --- src/TextureFetcher.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/TextureFetcher.cs b/src/TextureFetcher.cs index 59c470f..8173edf 100644 --- a/src/TextureFetcher.cs +++ b/src/TextureFetcher.cs @@ -135,6 +135,16 @@ namespace OpenSim.Modules.TextureFetcher 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. foreach (UUID texture in allTextures) { @@ -166,6 +176,7 @@ namespace OpenSim.Modules.TextureFetcher if (!isAssetInInventory(part, item.AssetID)) { updateNeeded = true; + part.ParentGroup.RootPart.Inventory.AddInventoryItem(item, false); } }