From 5cdd205ee7f3f785d9d6dd6eca1fcfb8e414313b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 21 Jul 2014 21:31:48 +0100 Subject: change presence movetotarget avoiding trying to go undergroud or fly when it can walk. ( still needs better code ) --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 93bcef2..3d361d6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2431,6 +2431,8 @@ namespace OpenSim.Region.Framework.Scenes targetScene = m_scene; float terrainHeight = (float)targetScene.Heightmap[(int)(pos.X % Constants.RegionSize), (int)(pos.Y % Constants.RegionSize)]; + // dont try to land underground + terrainHeight += Appearance.AvatarHeight / 2; pos.Z = Math.Max(terrainHeight, pos.Z); // Fudge factor. It appears that if one clicks "go here" on a piece of ground, the go here request is @@ -2442,10 +2444,11 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat( // "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}", // Name, pos, terrainHeight, m_scene.RegionInfo.RegionName); + if (noFly) Flying = false; - else if (pos.Z > terrainHeight) + else if (pos.Z > terrainHeight + Appearance.AvatarHeight / 2 || Flying) Flying = true; LandAtTarget = landAtTarget; -- cgit v1.1