Protect a check for default texture entry when setting alpha values. Apparently

if all faces have their own textures then the default texture is null
bulletsim
Mic Bowman 2011-08-23 10:52:12 -07:00
parent afd5469eec
commit ce011d7e44
1 changed files with 10 additions and 3 deletions

View File

@ -1619,9 +1619,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
tex.FaceTextures[i].RGBA = texcolor;
}
}
// In some cases, the default texture can be null, eg when every face
// has a unique texture
if (tex.DefaultTexture != null)
{
texcolor = tex.DefaultTexture.RGBA;
texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
tex.DefaultTexture.RGBA = texcolor;
}
part.UpdateTexture(tex);
return;
}