diff options
Diffstat (limited to 'OpenSim/Region/Environment/LandManagement/Land.cs')
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/Land.cs | 17 |
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) |