aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs25
1 files changed, 16 insertions, 9 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs
index 2ad784b..55ed90b 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs
@@ -143,15 +143,22 @@ namespace libTerrain
143 143
144 public double Get(int x, int y) 144 public double Get(int x, int y)
145 { 145 {
146 if (x >= w) 146 try
147 x = w - 1; 147 {
148 if (y >= h) 148 return map[x, y];
149 y = h - 1; 149 }
150 if (x < 0) 150 catch (IndexOutOfRangeException)
151 x = 0; 151 {
152 if (y < 0) 152 if (x >= w)
153 y = 0; 153 x = w - 1;
154 return map[x, y]; 154 if (y >= h)
155 y = h - 1;
156 if (x < 0)
157 x = 0;
158 if (y < 0)
159 y = 0;
160 return map[x, y];
161 }
155 } 162 }
156 163
157 public void SetWrap(int x, int y, double val) 164 public void SetWrap(int x, int y, double val)