diff options
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/LandManager.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs index dfeb36a..dd35a26 100644 --- a/OpenSim/Region/Environment/LandManagement/LandManager.cs +++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs | |||
@@ -209,7 +209,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
209 | int x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float)/Convert.ToDouble(4.0))); | 209 | int x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float)/Convert.ToDouble(4.0))); |
210 | int y = Convert.ToInt32(Math.Floor(Convert.ToDouble(y_float)/Convert.ToDouble(4.0))); | 210 | int y = Convert.ToInt32(Math.Floor(Convert.ToDouble(y_float)/Convert.ToDouble(4.0))); |
211 | 211 | ||
212 | if (x > 63 || y > 63 || x < 0 || y < 0) | 212 | if (x >= 64 || y >= 64 || x < 0 || y < 0) |
213 | { | 213 | { |
214 | throw new Exception("Error: Parcel not found at point " + x + ", " + y); | 214 | throw new Exception("Error: Parcel not found at point " + x + ", " + y); |
215 | } | 215 | } |
@@ -222,7 +222,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
222 | 222 | ||
223 | public Land getLandObject(int x, int y) | 223 | public Land getLandObject(int x, int y) |
224 | { | 224 | { |
225 | if (x > 256 || y > 256 || x < 0 || y < 0) | 225 | if (x >= 256 || y >= 256 || x < 0 || y < 0) |
226 | { | 226 | { |
227 | throw new Exception("Error: Parcel not found at point " + x + ", " + y); | 227 | throw new Exception("Error: Parcel not found at point " + x + ", " + y); |
228 | } | 228 | } |
@@ -535,8 +535,8 @@ namespace OpenSim.Region.Environment.LandManagement | |||
535 | 535 | ||
536 | public void sendLandUpdate(ScenePresence avatar) | 536 | public void sendLandUpdate(ScenePresence avatar) |
537 | { | 537 | { |
538 | Land over = getLandObject((int) Math.Round(avatar.AbsolutePosition.X), | 538 | Land over = getLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), |
539 | (int) Math.Round(avatar.AbsolutePosition.Y)); | 539 | (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); |
540 | 540 | ||
541 | if (over != null) | 541 | if (over != null) |
542 | { | 542 | { |