diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 7c3d50b9c1..9abc8ae049 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -822,7 +822,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } // if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) - if (NeedsNewAgent(sp.Scene.DefaultDrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) + float dist = (float)Math.Max(sp.Scene.DefaultDrawDistance, + (float)Math.Max(sp.Scene.RegionInfo.RegionSizeX, sp.Scene.RegionInfo.RegionSizeY)); + if (NeedsNewAgent(dist, oldRegionX, newRegionX, oldRegionY, newRegionY)) { // brand new agent, let's create a new caps seed agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); @@ -896,7 +898,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer IClientIPEndpoint ipepClient; string capsPath = String.Empty; - if (NeedsNewAgent(sp.Scene.DefaultDrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) + float dist = (float)Math.Max(sp.Scene.DefaultDrawDistance, + (float)Math.Max(sp.Scene.RegionInfo.RegionSizeX, sp.Scene.RegionInfo.RegionSizeY)); + if (NeedsNewAgent(dist, oldRegionX, newRegionX, oldRegionY, newRegionY)) { m_log.DebugFormat( "[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} needs new child agent for incoming agent {3} from {4}", @@ -1142,7 +1146,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer IClientIPEndpoint ipepClient; string capsPath = String.Empty; - if (NeedsNewAgent(sp.Scene.DefaultDrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) + float dist = (float)Math.Max(sp.Scene.DefaultDrawDistance, + (float)Math.Max(sp.Scene.RegionInfo.RegionSizeX, sp.Scene.RegionInfo.RegionSizeY)); + if (NeedsNewAgent(dist, oldRegionX, newRegionX, oldRegionY, newRegionY)) { m_log.DebugFormat( "[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} needs new child agent for agent {3} from {4}", diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 063ac73251..20c88e1eab 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3734,7 +3734,9 @@ namespace OpenSim.Region.Framework.Scenes // m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX))); // m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY))); - if (Util.IsOutsideView(DrawDistance, x, newRegionX, y, newRegionY)) + float dist = (float)Math.Max(Scene.DefaultDrawDistance, + (float)Math.Max(Scene.RegionInfo.RegionSizeX, Scene.RegionInfo.RegionSizeY)); + if (Util.IsOutsideView(dist, x, newRegionX, y, newRegionY)) { byebyeRegions.Add(handle); }