Sends the consistent child agent position upon creation of the child agent in other regions, as opposed to <128, 128, 70>
parent
3bf699ad36
commit
8300bb651e
|
@ -1213,7 +1213,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
AgentCircuitData agent = sp.ControllingClient.RequestClientInfo();
|
AgentCircuitData agent = sp.ControllingClient.RequestClientInfo();
|
||||||
agent.BaseFolder = UUID.Zero;
|
agent.BaseFolder = UUID.Zero;
|
||||||
agent.InventoryFolder = UUID.Zero;
|
agent.InventoryFolder = UUID.Zero;
|
||||||
agent.startpos = new Vector3(128, 128, 70);
|
agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, neighbour);
|
||||||
agent.child = true;
|
agent.child = true;
|
||||||
agent.Appearance = sp.Appearance;
|
agent.Appearance = sp.Appearance;
|
||||||
if (currentAgentCircuit != null)
|
if (currentAgentCircuit != null)
|
||||||
|
@ -1305,6 +1305,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vector3 CalculateOffset(ScenePresence sp, GridRegion neighbour)
|
||||||
|
{
|
||||||
|
int rRegionX = (int)sp.Scene.RegionInfo.RegionLocX;
|
||||||
|
int rRegionY = (int)sp.Scene.RegionInfo.RegionLocY;
|
||||||
|
int tRegionX = neighbour.RegionLocX / (int)Constants.RegionSize;
|
||||||
|
int tRegionY = neighbour.RegionLocY / (int)Constants.RegionSize;
|
||||||
|
int shiftx = (rRegionX - tRegionX) * (int)Constants.RegionSize;
|
||||||
|
int shifty = (rRegionY - tRegionY) * (int)Constants.RegionSize;
|
||||||
|
return new Vector3(shiftx, shifty, 0f);
|
||||||
|
}
|
||||||
|
|
||||||
private void InformClientOfNeighbourCompleted(IAsyncResult iar)
|
private void InformClientOfNeighbourCompleted(IAsyncResult iar)
|
||||||
{
|
{
|
||||||
InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState;
|
InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState;
|
||||||
|
|
Loading…
Reference in New Issue