* Fixes: 0001554: r5106 update fails to load on some regions with NullRef error on volume portion of maptile drawing routine.

0.6.0-stable
Teravus Ovares 2008-06-14 20:04:48 +00:00
parent 4af6286512
commit 7ca868dca5
1 changed files with 20 additions and 0 deletions

View File

@ -1160,6 +1160,9 @@ namespace OpenSim.Region.Environment.Scenes
// Loop over prim in group
foreach (SceneObjectPart part in mapdot.Children.Values)
{
if (part == null)
continue;
// Draw if the object is at least 1 meter wide in any direction
if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f)
{
@ -1168,6 +1171,23 @@ namespace OpenSim.Region.Environment.Scenes
try
{
LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA;
// Not sure why some of these are null, oh well.
if (part == null)
continue;
if (part.Shape == null)
continue;
if (part.Shape.Textures == null)
continue;
if (part.Shape.Textures.DefaultTexture == null)
continue;
int colorr = 255 - (int)(texcolor.R * 255f);
int colorg = 255 - (int)(texcolor.G * 255f);
int colorb = 255 - (int)(texcolor.B * 255f);