* Handle a NRE with Baked Textures that may result in a failed appearance. This may be an issue, or it may be a symptom.

avinationmerge
teravus 2013-01-22 18:49:50 -05:00
parent be60c0b010
commit 9d1989e64f
1 changed files with 18 additions and 3 deletions

View File

@ -190,8 +190,15 @@ namespace OpenSim.Region.ClientStack.Linden
{ {
if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex) if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex)
{ {
cacheItems[i].TextureID = Primitive.TextureEntryFace face = textureEntry.FaceTextures[cacheItems[i].TextureIndex];
textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID; 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) if (m_scene.AssetService != null)
cacheItems[i].TextureAsset = cacheItems[i].TextureAsset =
m_scene.AssetService.GetCached(cacheItems[i].TextureID.ToString()); m_scene.AssetService.GetCached(cacheItems[i].TextureID.ToString());
@ -213,8 +220,16 @@ namespace OpenSim.Region.ClientStack.Linden
{ {
if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex) 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 = cacheItems[i].TextureID =
textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID; face.TextureID;
} }
else else
{ {