diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-07 20:31:48 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-07 20:31:48 -0400 |
commit | 2b990a61bfa88e13d5ad19602e6acef751ea473c (patch) | |
tree | d7cf9705923c940646e2db3af67bdb98944d9392 /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | * Remove hard coded 256 limitations from various places. There's no more 2... (diff) | |
download | opensim-SC-2b990a61bfa88e13d5ad19602e6acef751ea473c.zip opensim-SC-2b990a61bfa88e13d5ad19602e6acef751ea473c.tar.gz opensim-SC-2b990a61bfa88e13d5ad19602e6acef751ea473c.tar.bz2 opensim-SC-2b990a61bfa88e13d5ad19602e6acef751ea473c.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index fd4ba71..5c6996f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -298,7 +298,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
298 | CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight"); | 298 | CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight"); |
299 | 299 | ||
300 | m_host.AddScriptLPS(1); | 300 | m_host.AddScriptLPS(1); |
301 | if (x > 255 || x < 0 || y > 255 || y < 0) | 301 | if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) |
302 | OSSLError("osTerrainSetHeight: Coordinate out of bounds"); | 302 | OSSLError("osTerrainSetHeight: Coordinate out of bounds"); |
303 | 303 | ||
304 | if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) | 304 | if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) |
@@ -317,7 +317,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
317 | CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight"); | 317 | CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight"); |
318 | 318 | ||
319 | m_host.AddScriptLPS(1); | 319 | m_host.AddScriptLPS(1); |
320 | if (x > 255 || x < 0 || y > 255 || y < 0) | 320 | if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) |
321 | OSSLError("osTerrainGetHeight: Coordinate out of bounds"); | 321 | OSSLError("osTerrainGetHeight: Coordinate out of bounds"); |
322 | 322 | ||
323 | return World.Heightmap[x, y]; | 323 | return World.Heightmap[x, y]; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 2408129..22c8887 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -31,6 +31,7 @@ using System.Threading; | |||
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Collections; | 32 | using System.Collections; |
33 | using System.Collections.Generic; | 33 | using System.Collections.Generic; |
34 | using OpenSim.Framework; | ||
34 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
35 | using OpenSim.Region.ScriptEngine.Interfaces; | 36 | using OpenSim.Region.ScriptEngine.Interfaces; |
36 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; | 37 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; |
@@ -443,12 +444,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
443 | } | 444 | } |
444 | private void Save() | 445 | private void Save() |
445 | { | 446 | { |
446 | if (Position.x > 255) | 447 | if (Position.x > ((int)Constants.RegionSize - 1)) |
447 | Position.x = 255; | 448 | Position.x = ((int)Constants.RegionSize - 1); |
448 | if (Position.x < 0) | 449 | if (Position.x < 0) |
449 | Position.x = 0; | 450 | Position.x = 0; |
450 | if (Position.y > 255) | 451 | if (Position.y > ((int)Constants.RegionSize - 1)) |
451 | Position.y = 255; | 452 | Position.y = ((int)Constants.RegionSize - 1); |
452 | if (Position.y < 0) | 453 | if (Position.y < 0) |
453 | Position.y = 0; | 454 | Position.y = 0; |
454 | if (Position.z > 768) | 455 | if (Position.z > 768) |