aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
authorUbitUmarov2015-08-19 08:48:50 +0100
committerUbitUmarov2015-08-19 08:48:50 +0100
commit0b105da626ae8c2fb519a817b827f90534ed7d08 (patch)
tree509e6d091fb12f38fd09528335e51aeedbe59c08 /OpenSim/Region/ScriptEngine/Shared/Api
parentMerge branch 'master' into ubitworkmaster (diff)
parentvarregion: update MapImageServiceModule to upload multiple map tiles for larg... (diff)
downloadopensim-SC_OLD-0b105da626ae8c2fb519a817b827f90534ed7d08.zip
opensim-SC_OLD-0b105da626ae8c2fb519a817b827f90534ed7d08.tar.gz
opensim-SC_OLD-0b105da626ae8c2fb519a817b827f90534ed7d08.tar.bz2
opensim-SC_OLD-0b105da626ae8c2fb519a817b827f90534ed7d08.tar.xz
Merge branch 'mbworkvar2' into ubitvar
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs17
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs10
3 files changed, 19 insertions, 18 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 3c8f54f..b5ba4a0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2352,7 +2352,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2352 // 2352 //
2353 // This workaround is to prevent silent failure of this function. 2353 // This workaround is to prevent silent failure of this function.
2354 // According to the specification on the SL Wiki, providing a position outside of the 2354 // According to the specification on the SL Wiki, providing a position outside of the
2355 if (pos.x < 0 || pos.x > Constants.RegionSize || pos.y < 0 || pos.y > Constants.RegionSize) 2355 if (pos.x < 0 || pos.x > World.RegionInfo.RegionSizeX || pos.y < 0 || pos.y > World.RegionInfo.RegionSizeY)
2356 { 2356 {
2357 return 0; 2357 return 0;
2358 } 2358 }
@@ -2362,9 +2362,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2362 m_host.ParentGroup.IsAttachment || // return FALSE if attachment 2362 m_host.ParentGroup.IsAttachment || // return FALSE if attachment
2363 ( 2363 (
2364 pos.x < -10.0 || // return FALSE if more than 10 meters into a west-adjacent region. 2364 pos.x < -10.0 || // return FALSE if more than 10 meters into a west-adjacent region.
2365 pos.x > (Constants.RegionSize + 10) || // return FALSE if more than 10 meters into a east-adjacent region. 2365 pos.x > (World.RegionInfo.RegionSizeX + 10) || // return FALSE if more than 10 meters into a east-adjacent region.
2366 pos.y < -10.0 || // return FALSE if more than 10 meters into a south-adjacent region. 2366 pos.y < -10.0 || // return FALSE if more than 10 meters into a south-adjacent region.
2367 pos.y > (Constants.RegionSize + 10) || // return FALSE if more than 10 meters into a north-adjacent region. 2367 pos.y > (World.RegionInfo.RegionSizeY + 10) || // return FALSE if more than 10 meters into a north-adjacent region.
2368 pos.z > Constants.RegionHeight // return FALSE if altitude than 4096m 2368 pos.z > Constants.RegionHeight // return FALSE if altitude than 4096m
2369 ) 2369 )
2370 ) 2370 )
@@ -4655,10 +4655,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4655 DataserverPlugin.RegisterRequest(m_host.LocalId, 4655 DataserverPlugin.RegisterRequest(m_host.LocalId,
4656 m_item.ItemID, item.AssetID.ToString()); 4656 m_item.ItemID, item.AssetID.ToString());
4657 4657
4658 Vector3 region = new Vector3( 4658 Vector3 region = new Vector3(World.RegionInfo.WorldLocX, World.RegionInfo.WorldLocY, 0);
4659 World.RegionInfo.RegionLocX * Constants.RegionSize,
4660 World.RegionInfo.RegionLocY * Constants.RegionSize,
4661 0);
4662 4659
4663 World.AssetService.Get(item.AssetID.ToString(), this, 4660 World.AssetService.Get(item.AssetID.ToString(), this,
4664 delegate(string i, object sender, AssetBase a) 4661 delegate(string i, object sender, AssetBase a)
@@ -5949,7 +5946,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5949 public LSL_Vector llGetRegionCorner() 5946 public LSL_Vector llGetRegionCorner()
5950 { 5947 {
5951 m_host.AddScriptLPS(1); 5948 m_host.AddScriptLPS(1);
5952 return new LSL_Vector(World.RegionInfo.RegionLocX * Constants.RegionSize, World.RegionInfo.RegionLocY * Constants.RegionSize, 0); 5949 return new LSL_Vector(World.RegionInfo.WorldLocX, World.RegionInfo.WorldLocY, 0);
5953 } 5950 }
5954 5951
5955 /// <summary> 5952 /// <summary>
@@ -6104,7 +6101,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6104 LSL_Float mag; 6101 LSL_Float mag;
6105 if (dir.x > 0) 6102 if (dir.x > 0)
6106 { 6103 {
6107 mag = (Constants.RegionSize - pos.x) / dir.x; 6104 mag = (World.RegionInfo.RegionSizeX - pos.x) / dir.x;
6108 } 6105 }
6109 else 6106 else
6110 { 6107 {
@@ -6115,7 +6112,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6115 6112
6116 edge.y = pos.y + (dir.y * mag); 6113 edge.y = pos.y + (dir.y * mag);
6117 6114
6118 if (edge.y > Constants.RegionSize || edge.y < 0) 6115 if (edge.y > World.RegionInfo.RegionSizeY || edge.y < 0)
6119 { 6116 {
6120 // Y goes out of bounds first 6117 // Y goes out of bounds first
6121 edge.y = dir.y / Math.Abs(dir.y); 6118 edge.y = dir.y / Math.Abs(dir.y);
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
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 9cf7b35..8666421 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -708,18 +708,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
708 } 708 }
709 private void Save() 709 private void Save()
710 { 710 {
711 /* Remove temporarily until we have a handle to the region size
711 if (Position.x > ((int)Constants.RegionSize - 1)) 712 if (Position.x > ((int)Constants.RegionSize - 1))
712 Position.x = ((int)Constants.RegionSize - 1); 713 Position.x = ((int)Constants.RegionSize - 1);
713 if (Position.x < 0)
714 Position.x = 0;
715 if (Position.y > ((int)Constants.RegionSize - 1)) 714 if (Position.y > ((int)Constants.RegionSize - 1))
716 Position.y = ((int)Constants.RegionSize - 1); 715 Position.y = ((int)Constants.RegionSize - 1);
716 */
717 if (Position.x < 0)
718 Position.x = 0;
717 if (Position.y < 0) 719 if (Position.y < 0)
718 Position.y = 0; 720 Position.y = 0;
719 if (Position.z > 768)
720 Position.z = 768;
721 if (Position.z < 0) 721 if (Position.z < 0)
722 Position.z = 0; 722 Position.z = 0;
723 if (Position.z > Constants.RegionHeight)
724 Position.z = Constants.RegionHeight;
723 prim.OSSL.llSetPos(Position); 725 prim.OSSL.llSetPos(Position);
724 } 726 }
725 727