For people receiving: Exception: System.ArgumentException: Value of -2147483648 is not valid for red, I've added the following message;
[MAPIMAGE]: Your terrain is corrupted in region {0}, it might take a few minutes to generate the map image depending on the corruption level And, I've also kept it from crashing...0.6.0-stable
parent
0896cb53d4
commit
2883656bbc
|
@ -1012,6 +1012,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
//Vector3 AXdirection = new Vector3();
|
//Vector3 AXdirection = new Vector3();
|
||||||
//Ray testRay = new Ray();
|
//Ray testRay = new Ray();
|
||||||
//EntityIntersection rt = new EntityIntersection();
|
//EntityIntersection rt = new EntityIntersection();
|
||||||
|
bool terraincorruptedwarningsaid = false;
|
||||||
|
|
||||||
float low = 255;
|
float low = 255;
|
||||||
float high = 0;
|
float high = 0;
|
||||||
|
@ -1063,12 +1064,26 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (heightvalue < 0)
|
if (heightvalue < 0)
|
||||||
heightvalue = 0;
|
heightvalue = 0;
|
||||||
|
|
||||||
|
if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue))
|
||||||
|
heightvalue = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
Color green = Color.FromArgb((int)heightvalue, 100, (int)heightvalue);
|
Color green = Color.FromArgb((int)heightvalue, 100, (int)heightvalue);
|
||||||
|
|
||||||
// Y flip the cordinates
|
// Y flip the cordinates
|
||||||
mapbmp.SetPixel(x, (256 - y) - 1, green);
|
mapbmp.SetPixel(x, (256 - y) - 1, green);
|
||||||
}
|
}
|
||||||
|
catch (System.ArgumentException)
|
||||||
|
{
|
||||||
|
if (!terraincorruptedwarningsaid)
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[MAPIMAGE]: Your terrain is corrupted in region {0}, it might take a few minutes to generate the map image depending on the corruption level",RegionInfo.RegionName);
|
||||||
|
terraincorruptedwarningsaid = true;
|
||||||
|
}
|
||||||
|
Color black = Color.Black;
|
||||||
|
mapbmp.SetPixel(x, (256 - y) - 1, black);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Y flip the cordinates
|
// Y flip the cordinates
|
||||||
|
@ -1086,13 +1101,31 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (heightvalue < 0)
|
if (heightvalue < 0)
|
||||||
heightvalue = 0;
|
heightvalue = 0;
|
||||||
|
|
||||||
|
if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue))
|
||||||
|
heightvalue = 0;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
Color water = Color.FromArgb((int)heightvalue, (int)heightvalue, 255);
|
Color water = Color.FromArgb((int)heightvalue, (int)heightvalue, 255);
|
||||||
mapbmp.SetPixel(x, (256 - y) - 1, water);
|
mapbmp.SetPixel(x, (256 - y) - 1, water);
|
||||||
}
|
}
|
||||||
|
catch (System.ArgumentException)
|
||||||
|
{
|
||||||
|
if (!terraincorruptedwarningsaid)
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[MAPIMAGE]: Your terrain is corrupted in region {0}, it might take a few minutes to generate the map image depending on the corruption level", RegionInfo.RegionName);
|
||||||
|
terraincorruptedwarningsaid = true;
|
||||||
|
}
|
||||||
|
Color black = Color.Black;
|
||||||
|
mapbmp.SetPixel(x, (256 - y) - 1, black);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
//tc = System.Environment.TickCount - tc;
|
//tc = System.Environment.TickCount - tc;
|
||||||
//m_log.Info("[MAPTILE]: Completed One row in " + tc + " ms");
|
//m_log.Info("[MAPTILE]: Completed One row in " + tc + " ms");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue