aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/LandManagement
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/LandManagement')
-rw-r--r--OpenSim/Region/Environment/LandManagement/LandManager.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs
index 22e7fc9..3969932 100644
--- a/OpenSim/Region/Environment/LandManagement/LandManager.cs
+++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs
@@ -243,8 +243,18 @@ namespace OpenSim.Region.Environment.LandManagement
243 /// <returns>Land object at the point supplied</returns> 243 /// <returns>Land object at the point supplied</returns>
244 public Land getLandObject(float x_float, float y_float) 244 public Land getLandObject(float x_float, float y_float)
245 { 245 {
246 int x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float)/Convert.ToDouble(4.0))); 246 int x;
247 int y = Convert.ToInt32(Math.Floor(Convert.ToDouble(y_float)/Convert.ToDouble(4.0))); 247 int y;
248
249 try
250 {
251 x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / Convert.ToDouble(4.0)));
252 y = Convert.ToInt32(Math.Floor(Convert.ToDouble(y_float) / Convert.ToDouble(4.0)));
253 }
254 catch (System.OverflowException)
255 {
256 return null;
257 }
248 258
249 if (x >= 64 || y >= 64 || x < 0 || y < 0) 259 if (x >= 64 || y >= 64 || x < 0 || y < 0)
250 { 260 {