mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 13:55:35 +08:00
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
This commit is contained in:
@@ -1619,9 +1619,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
tex.FaceTextures[i].RGBA = texcolor;
|
||||
}
|
||||
}
|
||||
texcolor = tex.DefaultTexture.RGBA;
|
||||
texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
|
||||
tex.DefaultTexture.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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user