diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6fd2544..499273c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -937,6 +937,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
937 | Vector3 pos = m_host.GetWorldPosition(); | 937 | Vector3 pos = m_host.GetWorldPosition(); |
938 | int x = (int)(pos.X + offset.x); | 938 | int x = (int)(pos.X + offset.x); |
939 | int y = (int)(pos.Y + offset.y); | 939 | int y = (int)(pos.Y + offset.y); |
940 | |||
941 | // Clamp to valid position | ||
942 | if (x<0) | ||
943 | x = 0; | ||
944 | else if (x>=World.Heightmap.Width) | ||
945 | x = World.Heightmap.Width-1; | ||
946 | if (y<0) | ||
947 | y = 0; | ||
948 | else if (y>=World.Heightmap.Height) | ||
949 | y = World.Heightmap.Height-1; | ||
950 | |||
951 | |||
940 | return World.GetLandHeight(x, y); | 952 | return World.GetLandHeight(x, y); |
941 | } | 953 | } |
942 | 954 | ||