diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs index a6e3859473..eabdf51d48 100644 --- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs @@ -478,7 +478,62 @@ namespace OpenSim.Region.CoreModules.World.Land public void PostInitialise() { - + if (!enabledYN) + return; + + // Create a set of infinite borders around the whole aabb of the combined island. + lock (m_regions) + { + foreach (RegionConnections rconn in m_regions.Values) + { + Vector3 offset = Vector3.Zero; + rconn.RegionScene.BordersLocked = true; + foreach (RegionData rdata in rconn.ConnectedRegions) + { + if (rdata.Offset.X > offset.X) offset.X = rdata.Offset.X; + if (rdata.Offset.Y > offset.Y) offset.Y = rdata.Offset.Y; + + } + + lock (rconn.RegionScene.NorthBorders) + { + Border northBorder = new Border(); + northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, + offset.Y + (int) Constants.RegionSize); //<--- + northBorder.CrossDirection = Cardinals.N; + rconn.RegionScene.NorthBorders.Add(northBorder); + } + + lock (rconn.RegionScene.SouthBorders) + { + Border southBorder = new Border(); + southBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, 0); //---> + southBorder.CrossDirection = Cardinals.S; + rconn.RegionScene.SouthBorders.Add(southBorder); + } + + lock (rconn.RegionScene.EastBorders) + { + Border eastBorder = new Border(); + eastBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, offset.Y + (int)Constants.RegionSize); + //<--- + eastBorder.CrossDirection = Cardinals.E; + rconn.RegionScene.EastBorders.Add(eastBorder); + } + + lock (rconn.RegionScene.WestBorders) + { + Border westBorder = new Border(); + westBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, 0); //---> + westBorder.CrossDirection = Cardinals.W; + rconn.RegionScene.WestBorders.Add(westBorder); + } + + + + rconn.RegionScene.BordersLocked = false; + } + } } public void OnFrame() {