From: Chris Yeoh (yeohc@au1.ibm.com)
Here's the patch that clamps llGround to using sane values avoiding runtime errors.0.6.0-stable
parent
87e7ff5932
commit
537cd4708f
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue