mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
NeighbourHandler child agents distances control
This commit is contained in:
@@ -1938,10 +1938,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
/// <param name="sp"></param>
|
||||
/// <param name="region"></param>
|
||||
public void EnableChildAgent(ScenePresence sp, GridRegion region)
|
||||
{
|
||||
{
|
||||
int viewrange =(int) sp.RegionViewDistance;
|
||||
Vector3 pos = sp.AbsolutePosition;
|
||||
RegionInfo curregion = sp.Scene.RegionInfo;
|
||||
|
||||
int rtmp = region.RegionLocX - (int)Util.RegionToWorldLoc(curregion.RegionLocX) - (int)pos.X;
|
||||
if (rtmp < -(viewrange + region.RegionSizeX) || rtmp > viewrange + curregion.RegionSizeX)
|
||||
return;
|
||||
rtmp = region.RegionLocY - (int)Util.RegionToWorldLoc(curregion.RegionLocY) - (int)pos.Y;
|
||||
if (rtmp < -(viewrange + region.RegionSizeY) || rtmp > viewrange + curregion.RegionSizeY)
|
||||
return;
|
||||
|
||||
m_log.DebugFormat("[ENTITY TRANSFER]: Enabling child agent in new neighbour {0}", region.RegionName);
|
||||
|
||||
ulong currentRegionHandler = sp.Scene.RegionInfo.RegionHandle;
|
||||
ulong currentRegionHandler = curregion.RegionHandle;
|
||||
ulong regionhandler = region.RegionHandle;
|
||||
|
||||
Dictionary<ulong, string> seeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
|
||||
|
||||
Reference in New Issue
Block a user