aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/LandManagement/Land.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-02-18 18:22:50 +0000
committerTeravus Ovares2008-02-18 18:22:50 +0000
commit5944d5e7f65a05596ca2b6005e59eea85e09e838 (patch)
tree7d91af2cc97dcc30fbe723dca514995e2a84d14a /OpenSim/Region/Environment/LandManagement/Land.cs
parent* Make RegionProfileData.RequestSimProfileData static (diff)
downloadopensim-SC_OLD-5944d5e7f65a05596ca2b6005e59eea85e09e838.zip
opensim-SC_OLD-5944d5e7f65a05596ca2b6005e59eea85e09e838.tar.gz
opensim-SC_OLD-5944d5e7f65a05596ca2b6005e59eea85e09e838.tar.bz2
opensim-SC_OLD-5944d5e7f65a05596ca2b6005e59eea85e09e838.tar.xz
* Fixed a land manager exception or two with Math.Max(255,Math.Min(0,val))
* Trapped a few more into little self contained boxes with padlocks on them.
Diffstat (limited to 'OpenSim/Region/Environment/LandManagement/Land.cs')
-rw-r--r--OpenSim/Region/Environment/LandManagement/Land.cs17
1 files changed, 14 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/LandManagement/Land.cs b/OpenSim/Region/Environment/LandManagement/Land.cs
index fec8899..58e40c2 100644
--- a/OpenSim/Region/Environment/LandManagement/Land.cs
+++ b/OpenSim/Region/Environment/LandManagement/Land.cs
@@ -47,6 +47,8 @@ namespace OpenSim.Region.Environment.LandManagement
47 { 47 {
48 #region Member Variables 48 #region Member Variables
49 49
50 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
51
50 public LandData landData = new LandData(); 52 public LandData landData = new LandData();
51 public List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); 53 public List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>();
52 public Scene m_scene; 54 public Scene m_scene;
@@ -282,11 +284,20 @@ namespace OpenSim.Region.Environment.LandManagement
282 public void sendLandUpdateToAvatarsOverMe() 284 public void sendLandUpdateToAvatarsOverMe()
283 { 285 {
284 List<ScenePresence> avatars = m_scene.GetAvatars(); 286 List<ScenePresence> avatars = m_scene.GetAvatars();
287 Land over = null;
285 for (int i = 0; i < avatars.Count; i++) 288 for (int i = 0; i < avatars.Count; i++)
286 { 289 {
287 Land over = 290 try
288 m_scene.LandManager.getLandObject((int) Math.Round(avatars[i].AbsolutePosition.X), 291 {
289 (int) Math.Round(avatars[i].AbsolutePosition.Y)); 292 over =
293 m_scene.LandManager.getLandObject((int)Math.Max(255,Math.Min(0,Math.Round(avatars[i].AbsolutePosition.X))),
294 (int)Math.Max(255,Math.Min(0,Math.Round(avatars[i].AbsolutePosition.Y))));
295 }
296 catch (Exception)
297 {
298 m_log.Warn("[LAND]: " + "unable to get land at x: " + Math.Round(avatars[i].AbsolutePosition.X) + " y: " + Math.Round(avatars[i].AbsolutePosition.Y));
299 }
300
290 if (over != null) 301 if (over != null)
291 { 302 {
292 if (over.landData.localID == landData.localID) 303 if (over.landData.localID == landData.localID)