This is the second part of the 'not crash on regionsize changes'. This lets you configure region sizes to be smaller without crashing the region. I remind you that regions are still square, must be a multiple of 4, and the Linden client doesn't like anything other then 256. If you set it bigger or smaller, the terrain doesn't load in the client, the map has issues, and god forbid you connect it to a grid that expects 256m regions.

This commit is contained in:
Teravus Ovares (Dan Olivares)
2009-08-07 20:31:48 -04:00
parent c8a68fb3fb
commit 2b990a61bf
22 changed files with 55 additions and 50 deletions

View File

@@ -298,7 +298,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight");
m_host.AddScriptLPS(1);
if (x > 255 || x < 0 || y > 255 || y < 0)
if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0)
OSSLError("osTerrainSetHeight: Coordinate out of bounds");
if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0)))
@@ -317,7 +317,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight");
m_host.AddScriptLPS(1);
if (x > 255 || x < 0 || y > 255 || y < 0)
if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0)
OSSLError("osTerrainGetHeight: Coordinate out of bounds");
return World.Heightmap[x, y];