From 9d1989e64fa460646f9a3d52d4024c3b56888617 Mon Sep 17 00:00:00 2001 From: teravus Date: Tue, 22 Jan 2013 18:49:50 -0500 Subject: * Handle a NRE with Baked Textures that may result in a failed appearance. This may be an issue, or it may be a symptom. --- .../Linden/Caps/UploadBakedTextureModule.cs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs index 6bed95f..eca576d 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs @@ -190,8 +190,15 @@ namespace OpenSim.Region.ClientStack.Linden { if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex) { - cacheItems[i].TextureID = - textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID; + Primitive.TextureEntryFace face = textureEntry.FaceTextures[cacheItems[i].TextureIndex]; + if (face == null) + { + textureEntry.CreateFace(cacheItems[i].TextureIndex); + textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID = + AppearanceManager.DEFAULT_AVATAR_TEXTURE; + continue; + } + cacheItems[i].TextureID =face.TextureID; if (m_scene.AssetService != null) cacheItems[i].TextureAsset = m_scene.AssetService.GetCached(cacheItems[i].TextureID.ToString()); @@ -213,8 +220,16 @@ namespace OpenSim.Region.ClientStack.Linden { if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex) { + Primitive.TextureEntryFace face = textureEntry.FaceTextures[cacheItems[i].TextureIndex]; + if (face == null) + { + textureEntry.CreateFace(cacheItems[i].TextureIndex); + textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID = + AppearanceManager.DEFAULT_AVATAR_TEXTURE; + continue; + } cacheItems[i].TextureID = - textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID; + face.TextureID; } else { -- cgit v1.1