Restore terrain height and flying adjustments that were eliminated from non-megaregion paths in ScenePresence.MoveToTarget() by recent patch bc969a6b

0.8.0.3
Justin Clark-Casey (justincc) 2014-04-29 20:05:08 +01:00
parent 2dbc18054e
commit d4eee213a9
1 changed files with 24 additions and 24 deletions

View File

@ -2460,6 +2460,8 @@ namespace OpenSim.Region.Framework.Scenes
|| pos.Z < 0) || pos.Z < 0)
return; return;
Scene targetScene = m_scene;
// Vector3 heightAdjust = new Vector3(0, 0, Appearance.AvatarHeight / 2); // Vector3 heightAdjust = new Vector3(0, 0, Appearance.AvatarHeight / 2);
// pos += heightAdjust; // pos += heightAdjust;
// //
@ -2476,17 +2478,16 @@ namespace OpenSim.Region.Framework.Scenes
if (regionCombinerModule != null) if (regionCombinerModule != null)
{ {
int X = (int)((m_scene.RegionInfo.WorldLocX) + pos.X); int x = (int)((m_scene.RegionInfo.WorldLocX) + pos.X);
int Y = (int)((m_scene.RegionInfo.WorldLocY) + pos.Y); int y = (int)((m_scene.RegionInfo.WorldLocY) + pos.Y);
GridRegion target_region = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, X, Y); GridRegion target_region = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, x, y);
// If X and Y is NaN, target_region will be null // If X and Y is NaN, target_region will be null
if (target_region == null) if (target_region == null)
return; return;
UUID target_regionID = target_region.RegionID;
Scene targetScene = m_scene;
if (!SceneManager.Instance.TryGetScene(target_regionID, out targetScene)) SceneManager.Instance.TryGetScene(target_region.RegionID, out targetScene);
targetScene = m_scene; }
float terrainHeight = (float)targetScene.Heightmap[(int)(pos.X % regionSize.X), (int)(pos.Y % regionSize.Y)]; float terrainHeight = (float)targetScene.Heightmap[(int)(pos.X % regionSize.X), (int)(pos.Y % regionSize.Y)];
pos.Z = Math.Max(terrainHeight, pos.Z); pos.Z = Math.Max(terrainHeight, pos.Z);
@ -2501,7 +2502,6 @@ namespace OpenSim.Region.Framework.Scenes
Flying = false; Flying = false;
else if (pos.Z > terrainHeight) else if (pos.Z > terrainHeight)
Flying = true; Flying = true;
}
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}", // "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}",