Guard against trying to access terrain heights out of bounds. Clamp to sim.
parent
8ade6fa617
commit
3f6071ce3a
|
@ -131,7 +131,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public double this[int x, int y]
|
public double this[int x, int y]
|
||||||
{
|
{
|
||||||
get { return map[x, y]; }
|
get
|
||||||
|
{
|
||||||
|
if (x < 0) x = 0;
|
||||||
|
if (y < 0) y = 0;
|
||||||
|
if (x >= (int)Constants.RegionSize) x = (int)Constants.RegionSize - 1;
|
||||||
|
if (y >= (int)Constants.RegionSize) y = (int)Constants.RegionSize - 1;
|
||||||
|
|
||||||
|
return map[x, y];
|
||||||
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
// Will "fix" terrain hole problems. Although not fantastically.
|
// Will "fix" terrain hole problems. Although not fantastically.
|
||||||
|
|
Loading…
Reference in New Issue