diff options
author | Melanie | 2012-11-20 20:25:15 +0000 |
---|---|---|
committer | Melanie | 2012-11-20 20:25:15 +0000 |
commit | 45eedb635a6d51efba2549802b75ea1369274409 (patch) | |
tree | 2689020c58f6fae0872a130584331e84ba591d15 /OpenSim/Region/Framework/Scenes | |
parent | Merge branch 'avination' into careminster (diff) | |
parent | If GetAgents() is called with an empty userIDs array then don't bother with a... (diff) | |
download | opensim-SC-45eedb635a6d51efba2549802b75ea1369274409.zip opensim-SC-45eedb635a6d51efba2549802b75ea1369274409.tar.gz opensim-SC-45eedb635a6d51efba2549802b75ea1369274409.tar.bz2 opensim-SC-45eedb635a6d51efba2549802b75ea1369274409.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 25a53b4..7f07d73 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1844,8 +1844,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1844 | // "[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}", | 1844 | // "[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}", |
1845 | // Name, pos, m_scene.RegionInfo.RegionName); | 1845 | // Name, pos, m_scene.RegionInfo.RegionName); |
1846 | 1846 | ||
1847 | if (pos.X < 0 || pos.X >= Constants.RegionSize | 1847 | // Allow move to another sub-region within a megaregion |
1848 | || pos.Y < 0 || pos.Y >= Constants.RegionSize | 1848 | Vector2 regionSize; |
1849 | IRegionCombinerModule regionCombinerModule = m_scene.RequestModuleInterface<IRegionCombinerModule>(); | ||
1850 | if (regionCombinerModule != null) | ||
1851 | regionSize = regionCombinerModule.GetSizeOfMegaregion(m_scene.RegionInfo.RegionID); | ||
1852 | else | ||
1853 | regionSize = new Vector2(Constants.RegionSize); | ||
1854 | |||
1855 | if (pos.X < 0 || pos.X >= regionSize.X | ||
1856 | || pos.Y < 0 || pos.Y >= regionSize.Y | ||
1849 | || pos.Z < 0) | 1857 | || pos.Z < 0) |
1850 | return; | 1858 | return; |
1851 | 1859 | ||
@@ -1859,7 +1867,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1859 | // pos.Z = AbsolutePosition.Z; | 1867 | // pos.Z = AbsolutePosition.Z; |
1860 | // } | 1868 | // } |
1861 | 1869 | ||
1862 | float terrainHeight = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y]; | 1870 | // Get terrain height for sub-region in a megaregion if necessary |
1871 | int X = (int)((m_scene.RegionInfo.RegionLocX * Constants.RegionSize) + pos.X); | ||
1872 | int Y = (int)((m_scene.RegionInfo.RegionLocY * Constants.RegionSize) + pos.Y); | ||
1873 | UUID target_regionID = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, X, Y).RegionID; | ||
1874 | Scene targetScene = m_scene; | ||
1875 | |||
1876 | if (!SceneManager.Instance.TryGetScene(target_regionID, out targetScene)) | ||
1877 | targetScene = m_scene; | ||
1878 | |||
1879 | float terrainHeight = (float)targetScene.Heightmap[(int)(pos.X % Constants.RegionSize), (int)(pos.Y % Constants.RegionSize)]; | ||
1863 | pos.Z = Math.Max(terrainHeight, pos.Z); | 1880 | pos.Z = Math.Max(terrainHeight, pos.Z); |
1864 | 1881 | ||
1865 | // Fudge factor. It appears that if one clicks "go here" on a piece of ground, the go here request is | 1882 | // Fudge factor. It appears that if one clicks "go here" on a piece of ground, the go here request is |