aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
diff options
context:
space:
mode:
authorRobert Adams2013-11-08 20:53:37 -0800
committerRobert Adams2013-11-08 20:53:37 -0800
commitbeeec1c46726a266edf5c8260f9cf4e4e6f91c8a (patch)
treeac749f4db4d4ee640bf9091b9684d2a36eedb284 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
parentvarregion: Massive work to LandManagementModule and LandObject to (diff)
downloadopensim-SC_OLD-beeec1c46726a266edf5c8260f9cf4e4e6f91c8a.zip
opensim-SC_OLD-beeec1c46726a266edf5c8260f9cf4e4e6f91c8a.tar.gz
opensim-SC_OLD-beeec1c46726a266edf5c8260f9cf4e4e6f91c8a.tar.bz2
opensim-SC_OLD-beeec1c46726a266edf5c8260f9cf4e4e6f91c8a.tar.xz
varregion: elimination of Constants.RegionSize from all over OpenSimulator.
Routines in Util to compute region world coordinates from region coordinates as well as the conversion to and from region handles. These routines have replaced a lot of math scattered throughout the simulator. Should be no functional changes.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index f4d5562..4fb0856 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -450,7 +450,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
450 { 450 {
451 m_host.AddScriptLPS(1); 451 m_host.AddScriptLPS(1);
452 452
453 if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) 453 if (x > (World.RegionInfo.RegionSizeX - 1) || x < 0 || y > (World.RegionInfo.RegionSizeY - 1) || y < 0)
454 OSSLError("osSetTerrainHeight: Coordinate out of bounds"); 454 OSSLError("osSetTerrainHeight: Coordinate out of bounds");
455 455
456 if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) 456 if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0)))
@@ -480,7 +480,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
480 private LSL_Float GetTerrainHeight(int x, int y) 480 private LSL_Float GetTerrainHeight(int x, int y)
481 { 481 {
482 m_host.AddScriptLPS(1); 482 m_host.AddScriptLPS(1);
483 if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) 483 if (x > (World.RegionInfo.RegionSizeX - 1) || x < 0 || y > (World.RegionInfo.RegionSizeY - 1) || y < 0)
484 OSSLError("osGetTerrainHeight: Coordinate out of bounds"); 484 OSSLError("osGetTerrainHeight: Coordinate out of bounds");
485 485
486 return World.Heightmap[x, y]; 486 return World.Heightmap[x, y];
@@ -814,7 +814,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
814 private void TeleportAgent(string agent, int regionX, int regionY, 814 private void TeleportAgent(string agent, int regionX, int regionY,
815 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions) 815 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions)
816 { 816 {
817 ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize)); 817 // ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize));
818 ulong regionHandle = Util.RegionWorldLocToHandle(Util.RegionToWorldLoc((uint)regionX), Util.RegionToWorldLoc((uint)regionY));
818 819
819 m_host.AddScriptLPS(1); 820 m_host.AddScriptLPS(1);
820 UUID agentId = new UUID(); 821 UUID agentId = new UUID();