From 64392b4fac835bbc86e0bb8acfef20550cf257df Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 20 Jan 2008 05:51:38 +0000 Subject: * Found and fixed a situation where a neighbor region would come up send a notice and would be tagged as 'too far away' when it was right next door. --- OpenSim/Region/Environment/Scenes/Scene.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index f327b2b..76f6c60 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -335,8 +335,12 @@ namespace OpenSim.Region.Environment.Scenes m_neighbours.Add(otherRegion); } } - if ((Math.Abs(otherRegion.RegionLocX - RegionInfo.RegionLocX) <= 1) && - (Math.Abs(otherRegion.RegionLocY - RegionInfo.RegionLocY) <= 1)) + // If these are cast to INT because long + negative values + abs returns invalid data + + int resultX = Math.Abs((int)otherRegion.RegionLocX - (int)RegionInfo.RegionLocX); + int resultY = Math.Abs((int)otherRegion.RegionLocY - (int)RegionInfo.RegionLocY); + if ((resultX <= 1) && + ( resultY <= 1)) { try { -- cgit v1.1