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.
0.6.0-stable
Dr Scofield 2008-10-07 11:33:41 +00:00
parent 47c2bd2b95
commit 7d525843d0
1 changed files with 3 additions and 2 deletions

View File

@ -937,8 +937,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Float llGround(LSL_Vector offset) public LSL_Float llGround(LSL_Vector offset)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
int x = (int)(m_host.OffsetPosition.X + offset.x); Vector3 pos = m_host.GetWorldPosition();
int y = (int)(m_host.OffsetPosition.Y + offset.y); int x = (int)(pos.X + offset.x);
int y = (int)(pos.Y + offset.y);
return World.GetLandHeight(x, y); return World.GetLandHeight(x, y);
} }