From 11e1948b57f96e7d22c56e82bfb15b93f62a5cef Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 5 Mar 2009 21:10:39 +0000 Subject: * Replace Scene.GetLandHeight() with a straight query to Scene.Heightmap (which is used in other contexts) --- .../Shared/Api/Implementation/LSL_Api.cs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') 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 int y = (int)(pos.Y + offset.y); // Clamp to valid position - if (x<0) + if (x < 0) x = 0; - else if (x>=World.Heightmap.Width) - x = World.Heightmap.Width-1; - if (y<0) + else if (x >= World.Heightmap.Width) + x = World.Heightmap.Width - 1; + if (y < 0) y = 0; - else if (y>=World.Heightmap.Height) - y = World.Heightmap.Height-1; - - - return World.GetLandHeight(x, y); + else if (y >= World.Heightmap.Height) + y = World.Heightmap.Height - 1; + + return World.Heightmap[x, y]; } public LSL_Float llCloud(LSL_Vector offset) @@ -2794,15 +2793,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } - - public void llSetHoverHeight(double height, int water, double tau) { m_host.AddScriptLPS(1); Vector3 pos = m_host.GetWorldPosition(); int x = (int)(pos.X); int y = (int)(pos.Y); - float landHeight = (float)World.GetLandHeight(x, y); + float landHeight = (float)World.Heightmap[x, y]; float targetHeight = landHeight + (float)height; if (water == 1) { -- cgit v1.1