aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-03-05 21:10:39 +0000
committerJustin Clarke Casey2009-03-05 21:10:39 +0000
commit11e1948b57f96e7d22c56e82bfb15b93f62a5cef (patch)
tree854a974e8a9870b7070c28b070f62557d98e13a5 /OpenSim/Region/ScriptEngine/Shared
parent* refactor: move media and music url setting from scene into LandObject (diff)
downloadopensim-SC_OLD-11e1948b57f96e7d22c56e82bfb15b93f62a5cef.zip
opensim-SC_OLD-11e1948b57f96e7d22c56e82bfb15b93f62a5cef.tar.gz
opensim-SC_OLD-11e1948b57f96e7d22c56e82bfb15b93f62a5cef.tar.bz2
opensim-SC_OLD-11e1948b57f96e7d22c56e82bfb15b93f62a5cef.tar.xz
* Replace Scene.GetLandHeight() with a straight query to Scene.Heightmap (which is used in other contexts)
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs21
1 files changed, 9 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 5be967e..fad456f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1007,17 +1007,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1007 int y = (int)(pos.Y + offset.y); 1007 int y = (int)(pos.Y + offset.y);
1008 1008
1009 // Clamp to valid position 1009 // Clamp to valid position
1010 if (x<0) 1010 if (x < 0)
1011 x = 0; 1011 x = 0;
1012 else if (x>=World.Heightmap.Width) 1012 else if (x >= World.Heightmap.Width)
1013 x = World.Heightmap.Width-1; 1013 x = World.Heightmap.Width - 1;
1014 if (y<0) 1014 if (y < 0)
1015 y = 0; 1015 y = 0;
1016 else if (y>=World.Heightmap.Height) 1016 else if (y >= World.Heightmap.Height)
1017 y = World.Heightmap.Height-1; 1017 y = World.Heightmap.Height - 1;
1018 1018
1019 1019 return World.Heightmap[x, y];
1020 return World.GetLandHeight(x, y);
1021 } 1020 }
1022 1021
1023 public LSL_Float llCloud(LSL_Vector offset) 1022 public LSL_Float llCloud(LSL_Vector offset)
@@ -2794,15 +2793,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2794 } 2793 }
2795 } 2794 }
2796 2795
2797
2798
2799 public void llSetHoverHeight(double height, int water, double tau) 2796 public void llSetHoverHeight(double height, int water, double tau)
2800 { 2797 {
2801 m_host.AddScriptLPS(1); 2798 m_host.AddScriptLPS(1);
2802 Vector3 pos = m_host.GetWorldPosition(); 2799 Vector3 pos = m_host.GetWorldPosition();
2803 int x = (int)(pos.X); 2800 int x = (int)(pos.X);
2804 int y = (int)(pos.Y); 2801 int y = (int)(pos.Y);
2805 float landHeight = (float)World.GetLandHeight(x, y); 2802 float landHeight = (float)World.Heightmap[x, y];
2806 float targetHeight = landHeight + (float)height; 2803 float targetHeight = landHeight + (float)height;
2807 if (water == 1) 2804 if (water == 1)
2808 { 2805 {