From 7d525843d04ceaf9d17389dad61d557e6f50109b Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Tue, 7 Oct 2008 11:33:41 +0000 Subject: From: chris yeoh 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. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs') 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 public LSL_Float llGround(LSL_Vector offset) { m_host.AddScriptLPS(1); - int x = (int)(m_host.OffsetPosition.X + offset.x); - int y = (int)(m_host.OffsetPosition.Y + offset.y); + Vector3 pos = m_host.GetWorldPosition(); + int x = (int)(pos.X + offset.x); + int y = (int)(pos.Y + offset.y); return World.GetLandHeight(x, y); } -- cgit v1.1