Here's the patch that clamps llGround to using sane values avoiding
runtime errors.
0.6.0-stable
Dr Scofield 2008-10-30 15:09:43 +00:00
parent 87e7ff5932
commit 537cd4708f
1 changed files with 12 additions and 0 deletions

View File

@ -937,6 +937,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
Vector3 pos = m_host.GetWorldPosition();
int x = (int)(pos.X + offset.x);
int y = (int)(pos.Y + offset.y);
// Clamp to valid position
if (x<0)
x = 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);
}