diff options
author | Dr Scofield | 2008-10-07 11:33:41 +0000 |
---|---|---|
committer | Dr Scofield | 2008-10-07 11:33:41 +0000 |
commit | 7d525843d04ceaf9d17389dad61d557e6f50109b (patch) | |
tree | a663c3041df4caddfc5052b76d5142550492f27b /OpenSim/Region/ScriptEngine/Shared | |
parent | From: chris yeoh <yeohc@au1.ibm.com> (diff) | |
download | opensim-SC_OLD-7d525843d04ceaf9d17389dad61d557e6f50109b.zip opensim-SC_OLD-7d525843d04ceaf9d17389dad61d557e6f50109b.tar.gz opensim-SC_OLD-7d525843d04ceaf9d17389dad61d557e6f50109b.tar.bz2 opensim-SC_OLD-7d525843d04ceaf9d17389dad61d557e6f50109b.tar.xz |
From: chris yeoh <yeohc@au1.ibm.com>
Attached is a patch for LLGround which was just plain broken and could
cause a runtime error. It now returns valid data with valid input (ie
the offset does not take the position off the edge of the sim), but a
runtime error will occur if invalid data is given.
On invalid data the LL servers return the ground height based on a
valid point closest to the effective position calculated using the
supplied offset. Is the OpenSim convention to replicate the LL servers
as closely as possible? If so I can submit an additional patch to
replicate the LL behaviour.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1031889..ccc483c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -937,8 +937,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
937 | public LSL_Float llGround(LSL_Vector offset) | 937 | public LSL_Float llGround(LSL_Vector offset) |
938 | { | 938 | { |
939 | m_host.AddScriptLPS(1); | 939 | m_host.AddScriptLPS(1); |
940 | int x = (int)(m_host.OffsetPosition.X + offset.x); | 940 | Vector3 pos = m_host.GetWorldPosition(); |
941 | int y = (int)(m_host.OffsetPosition.Y + offset.y); | 941 | int x = (int)(pos.X + offset.x); |
942 | int y = (int)(pos.Y + offset.y); | ||
942 | return World.GetLandHeight(x, y); | 943 | return World.GetLandHeight(x, y); |
943 | } | 944 | } |
944 | 945 | ||