aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMic Bowman2011-08-23 10:52:12 -0700
committerMic Bowman2011-08-23 10:52:12 -0700
commitce011d7e446e8f05247fc4ed7e0af5a94afbb074 (patch)
tree32d7be949730f5174a834d1abc590ba3f8586c3f
parentRemove pointless contains check in ScenePresence.RemoveAttachment() (diff)
downloadopensim-SC-ce011d7e446e8f05247fc4ed7e0af5a94afbb074.zip
opensim-SC-ce011d7e446e8f05247fc4ed7e0af5a94afbb074.tar.gz
opensim-SC-ce011d7e446e8f05247fc4ed7e0af5a94afbb074.tar.bz2
opensim-SC-ce011d7e446e8f05247fc4ed7e0af5a94afbb074.tar.xz
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
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs13
1 files changed, 10 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ef67a0c..24be7d4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1619,9 +1619,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1619 tex.FaceTextures[i].RGBA = texcolor; 1619 tex.FaceTextures[i].RGBA = texcolor;
1620 } 1620 }
1621 } 1621 }
1622 texcolor = tex.DefaultTexture.RGBA; 1622
1623 texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); 1623 // In some cases, the default texture can be null, eg when every face
1624 tex.DefaultTexture.RGBA = texcolor; 1624 // has a unique texture
1625 if (tex.DefaultTexture != null)
1626 {
1627 texcolor = tex.DefaultTexture.RGBA;
1628 texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
1629 tex.DefaultTexture.RGBA = texcolor;
1630 }
1631
1625 part.UpdateTexture(tex); 1632 part.UpdateTexture(tex);
1626 return; 1633 return;
1627 } 1634 }