diff options
author | Diva Canto | 2011-12-16 09:33:22 -0800 |
---|---|---|
committer | Diva Canto | 2011-12-16 09:33:22 -0800 |
commit | 8300bb651e3d1b3c41bc7923cefde3f3ea96923d (patch) | |
tree | 8a74b669dc60a521e9492c4cf29e953b459959c0 /OpenSim/Region/CoreModules | |
parent | No functional changes. Changed the prefix of that log message [CONNECTION BEG... (diff) | |
download | opensim-SC-8300bb651e3d1b3c41bc7923cefde3f3ea96923d.zip opensim-SC-8300bb651e3d1b3c41bc7923cefde3f3ea96923d.tar.gz opensim-SC-8300bb651e3d1b3c41bc7923cefde3f3ea96923d.tar.bz2 opensim-SC-8300bb651e3d1b3c41bc7923cefde3f3ea96923d.tar.xz |
Sends the consistent child agent position upon creation of the child agent in other regions, as opposed to <128, 128, 70>
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 2f947fd..87f292c 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1213,7 +1213,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1213 | AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); | 1213 | AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); |
1214 | agent.BaseFolder = UUID.Zero; | 1214 | agent.BaseFolder = UUID.Zero; |
1215 | agent.InventoryFolder = UUID.Zero; | 1215 | agent.InventoryFolder = UUID.Zero; |
1216 | agent.startpos = new Vector3(128, 128, 70); | 1216 | agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, neighbour); |
1217 | agent.child = true; | 1217 | agent.child = true; |
1218 | agent.Appearance = sp.Appearance; | 1218 | agent.Appearance = sp.Appearance; |
1219 | if (currentAgentCircuit != null) | 1219 | if (currentAgentCircuit != null) |
@@ -1305,6 +1305,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1305 | } | 1305 | } |
1306 | } | 1306 | } |
1307 | 1307 | ||
1308 | Vector3 CalculateOffset(ScenePresence sp, GridRegion neighbour) | ||
1309 | { | ||
1310 | int rRegionX = (int)sp.Scene.RegionInfo.RegionLocX; | ||
1311 | int rRegionY = (int)sp.Scene.RegionInfo.RegionLocY; | ||
1312 | int tRegionX = neighbour.RegionLocX / (int)Constants.RegionSize; | ||
1313 | int tRegionY = neighbour.RegionLocY / (int)Constants.RegionSize; | ||
1314 | int shiftx = (rRegionX - tRegionX) * (int)Constants.RegionSize; | ||
1315 | int shifty = (rRegionY - tRegionY) * (int)Constants.RegionSize; | ||
1316 | return new Vector3(shiftx, shifty, 0f); | ||
1317 | } | ||
1318 | |||
1308 | private void InformClientOfNeighbourCompleted(IAsyncResult iar) | 1319 | private void InformClientOfNeighbourCompleted(IAsyncResult iar) |
1309 | { | 1320 | { |
1310 | InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState; | 1321 | InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState; |