aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs
diff options
context:
space:
mode:
authorteravus2013-01-22 18:49:50 -0500
committerteravus2013-01-22 18:49:50 -0500
commit9d1989e64fa460646f9a3d52d4024c3b56888617 (patch)
tree0816386e1bd8e2ae7168bb20f9a051ceca1d7a61 /OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs
parent* A better way to handle the last fix (This is in case the viewer provides a ... (diff)
downloadopensim-SC-9d1989e64fa460646f9a3d52d4024c3b56888617.zip
opensim-SC-9d1989e64fa460646f9a3d52d4024c3b56888617.tar.gz
opensim-SC-9d1989e64fa460646f9a3d52d4024c3b56888617.tar.bz2
opensim-SC-9d1989e64fa460646f9a3d52d4024c3b56888617.tar.xz
* Handle a NRE with Baked Textures that may result in a failed appearance. This may be an issue, or it may be a symptom.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs21
1 files changed, 18 insertions, 3 deletions
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
190 { 190 {
191 if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex) 191 if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex)
192 { 192 {
193 cacheItems[i].TextureID = 193 Primitive.TextureEntryFace face = textureEntry.FaceTextures[cacheItems[i].TextureIndex];
194 textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID; 194 if (face == null)
195 {
196 textureEntry.CreateFace(cacheItems[i].TextureIndex);
197 textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID =
198 AppearanceManager.DEFAULT_AVATAR_TEXTURE;
199 continue;
200 }
201 cacheItems[i].TextureID =face.TextureID;
195 if (m_scene.AssetService != null) 202 if (m_scene.AssetService != null)
196 cacheItems[i].TextureAsset = 203 cacheItems[i].TextureAsset =
197 m_scene.AssetService.GetCached(cacheItems[i].TextureID.ToString()); 204 m_scene.AssetService.GetCached(cacheItems[i].TextureID.ToString());
@@ -213,8 +220,16 @@ namespace OpenSim.Region.ClientStack.Linden
213 { 220 {
214 if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex) 221 if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex)
215 { 222 {
223 Primitive.TextureEntryFace face = textureEntry.FaceTextures[cacheItems[i].TextureIndex];
224 if (face == null)
225 {
226 textureEntry.CreateFace(cacheItems[i].TextureIndex);
227 textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID =
228 AppearanceManager.DEFAULT_AVATAR_TEXTURE;
229 continue;
230 }
216 cacheItems[i].TextureID = 231 cacheItems[i].TextureID =
217 textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID; 232 face.TextureID;
218 } 233 }
219 else 234 else
220 { 235 {