From 3730163e5d469addc9c225cb9ab2c74dc2e9cb1f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 4 Jul 2014 11:45:30 -0700 Subject: This fixes the bug related to rebooting neighboring varregions while avatars are logged in; the avies would not see the region anymore until they relogged. Same problem as before: inconsistent calculation of scope. --- OpenSim/Region/Framework/Scenes/Scene.cs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 3957ba6..27042a3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1069,18 +1069,22 @@ namespace OpenSim.Region.Framework.Scenes /// True after all operations complete, throws exceptions otherwise. public override void OtherRegionUp(GridRegion otherRegion) { - uint xcell = Util.WorldToRegionLoc((uint)otherRegion.RegionLocX); - uint ycell = Util.WorldToRegionLoc((uint)otherRegion.RegionLocY); - - //m_log.InfoFormat("[SCENE]: (on region {0}): Region {1} up in coords {2}-{3}", - // RegionInfo.RegionName, otherRegion.RegionName, xcell, ycell); - if (RegionInfo.RegionHandle != otherRegion.RegionHandle) { - // If these are cast to INT because long + negative values + abs returns invalid data - int resultX = Math.Abs((int)xcell - (int)RegionInfo.RegionLocX); - int resultY = Math.Abs((int)ycell - (int)RegionInfo.RegionLocY); - if (resultX <= 1 && resultY <= 1) + //// If these are cast to INT because long + negative values + abs returns invalid data + //int resultX = Math.Abs((int)xcell - (int)RegionInfo.RegionLocX); + //int resultY = Math.Abs((int)ycell - (int)RegionInfo.RegionLocY); + //if (resultX <= 1 && resultY <= 1) + float dist = (float)Math.Max(DefaultDrawDistance, + (float)Math.Max(RegionInfo.RegionSizeX, RegionInfo.RegionSizeY)); + uint newRegionX, newRegionY, thisRegionX, thisRegionY; + Util.RegionHandleToRegionLoc(otherRegion.RegionHandle, out newRegionX, out newRegionY); + Util.RegionHandleToRegionLoc(RegionInfo.RegionHandle, out thisRegionX, out thisRegionY); + + //m_log.InfoFormat("[SCENE]: (on region {0}): Region {1} up in coords {2}-{3}", + // RegionInfo.RegionName, otherRegion.RegionName, newRegionX, newRegionY); + + if (!Util.IsOutsideView(dist, thisRegionX, newRegionX, thisRegionY, newRegionY)) { // Let the grid service module know, so this can be cached m_eventManager.TriggerOnRegionUp(otherRegion); -- cgit v1.1