diff options
author | Robert Adams | 2015-03-29 14:25:12 -0700 |
---|---|---|
committer | Robert Adams | 2015-03-29 14:25:12 -0700 |
commit | 07dead7dcb8b0f2a27a50748e4a460d9669903fc (patch) | |
tree | b61c3d892e83d36fece40e7735c5d97e64b9020f /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |
parent | varregion: add varregion and TerrainData use in LLClientView. (diff) | |
download | opensim-SC_OLD-07dead7dcb8b0f2a27a50748e4a460d9669903fc.zip opensim-SC_OLD-07dead7dcb8b0f2a27a50748e4a460d9669903fc.tar.gz opensim-SC_OLD-07dead7dcb8b0f2a27a50748e4a460d9669903fc.tar.bz2 opensim-SC_OLD-07dead7dcb8b0f2a27a50748e4a460d9669903fc.tar.xz |
varregion: any conversions of use of Constants.RegionSize converted into
Util.cs routines to convert region coords to and from world coords or handles.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index d2a5980..01d90e7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -459,7 +459,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
459 | { | 459 | { |
460 | m_host.AddScriptLPS(1); | 460 | m_host.AddScriptLPS(1); |
461 | 461 | ||
462 | if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) | 462 | if (x > (World.RegionInfo.RegionSizeX - 1) || x < 0 || y > (World.RegionInfo.RegionSizeY - 1) || y < 0) |
463 | OSSLError("osSetTerrainHeight: Coordinate out of bounds"); | 463 | OSSLError("osSetTerrainHeight: Coordinate out of bounds"); |
464 | 464 | ||
465 | if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) | 465 | if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) |
@@ -489,7 +489,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
489 | private LSL_Float GetTerrainHeight(int x, int y) | 489 | private LSL_Float GetTerrainHeight(int x, int y) |
490 | { | 490 | { |
491 | m_host.AddScriptLPS(1); | 491 | m_host.AddScriptLPS(1); |
492 | if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) | 492 | if (x > (World.RegionInfo.RegionSizeX - 1) || x < 0 || y > (World.RegionInfo.RegionSizeY - 1) || y < 0) |
493 | OSSLError("osGetTerrainHeight: Coordinate out of bounds"); | 493 | OSSLError("osGetTerrainHeight: Coordinate out of bounds"); |
494 | 494 | ||
495 | return World.Heightmap[x, y]; | 495 | return World.Heightmap[x, y]; |
@@ -823,7 +823,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
823 | private void TeleportAgent(string agent, int regionX, int regionY, | 823 | private void TeleportAgent(string agent, int regionX, int regionY, |
824 | LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions) | 824 | LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions) |
825 | { | 825 | { |
826 | ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize)); | 826 | ulong regionHandle = Util.RegionLocToHandle((uint)regionX, (uint)regionY); |
827 | 827 | ||
828 | m_host.AddScriptLPS(1); | 828 | m_host.AddScriptLPS(1); |
829 | UUID agentId = new UUID(); | 829 | UUID agentId = new UUID(); |
@@ -3024,7 +3024,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3024 | } | 3024 | } |
3025 | else | 3025 | else |
3026 | { | 3026 | { |
3027 | return new LSL_Vector((float)Constants.RegionSize, (float)Constants.RegionSize, Constants.RegionHeight); | 3027 | return new LSL_Vector((float)World.RegionInfo.RegionSizeX, |
3028 | (float)World.RegionInfo.RegionSizeY, | ||
3029 | (float)World.RegionInfo.RegionSizeZ ); | ||
3028 | } | 3030 | } |
3029 | } | 3031 | } |
3030 | 3032 | ||