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.

0.8.0.3
Diva Canto 2014-07-04 11:45:30 -07:00 committed by Justin Clark-Casey
parent 4e3a2d3a64
commit 3730163e5d
1 changed files with 14 additions and 10 deletions

View File

@ -1069,18 +1069,22 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns>True after all operations complete, throws exceptions otherwise.</returns>
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);