From d9e45332022b18b50f00353588afd4bbe3392870 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 13 Jan 2008 07:14:54 +0000 Subject: * Fixed an overflow in the land manager * Did some goofy math undoing in the Sim Stats Reporter * More reduction to the amount of calls per second to UnManaged ODE code * Added a significant amount of comments to ODE --- OpenSim/Region/Environment/LandManagement/LandManager.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment/LandManagement') 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 /// Land object at the point supplied public Land getLandObject(float x_float, float y_float) { - int x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float)/Convert.ToDouble(4.0))); - int y = Convert.ToInt32(Math.Floor(Convert.ToDouble(y_float)/Convert.ToDouble(4.0))); + int x; + int y; + + try + { + x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / Convert.ToDouble(4.0))); + y = Convert.ToInt32(Math.Floor(Convert.ToDouble(y_float) / Convert.ToDouble(4.0))); + } + catch (System.OverflowException) + { + return null; + } if (x >= 64 || y >= 64 || x < 0 || y < 0) { -- cgit v1.1