From a2a46a18ae0bcdbac201c7398d13b23b8b3cd285 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Thu, 6 Sep 2012 10:54:45 +0100 Subject: [PATCH] 4096 is used in various places as the maximum height of a region, refactoring to be a constant --- OpenSim/Framework/Constants.cs | 1 + .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- .../Connectors/SimianGrid/SimianGridServiceConnector.cs | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenSim/Framework/Constants.cs b/OpenSim/Framework/Constants.cs index 1b1aaf2bc4..a2eb5ee18e 100644 --- a/OpenSim/Framework/Constants.cs +++ b/OpenSim/Framework/Constants.cs @@ -31,6 +31,7 @@ namespace OpenSim.Framework public class Constants { public const uint RegionSize = 256; + public const uint RegionHeight = 4096; public const byte TerrainPatchSize = 16; public const string DefaultTexture = "89556747-24cb-43ed-920b-47caed15465f"; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f815a11dfa..77f71df543 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1968,7 +1968,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api pos.x > (Constants.RegionSize + 10) || // return FALSE if more than 10 meters into a east-adjacent region. pos.y < -10.0 || // return FALSE if more than 10 meters into a south-adjacent region. pos.y > (Constants.RegionSize + 10) || // return FALSE if more than 10 meters into a north-adjacent region. - pos.z > 4096 // return FALSE if altitude than 4096m + pos.z > Constants.RegionHeight // return FALSE if altitude than 4096m ) ) { diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 67a65ff623..35cb408a91 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs @@ -101,7 +101,7 @@ namespace OpenSim.Services.Connectors.SimianGrid public string RegisterRegion(UUID scopeID, GridRegion regionInfo) { Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0); - Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0); + Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); OSDMap extraData = new OSDMap { @@ -286,7 +286,7 @@ namespace OpenSim.Services.Connectors.SimianGrid List foundRegions = new List(); Vector3d minPosition = new Vector3d(xmin, ymin, 0.0); - Vector3d maxPosition = new Vector3d(xmax, ymax, 4096.0); + Vector3d maxPosition = new Vector3d(xmax, ymax, Constants.RegionHeight); NameValueCollection requestArgs = new NameValueCollection {