diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 |
1 files changed, 4 insertions, 1 deletions
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 | |||
2431 | targetScene = m_scene; | 2431 | targetScene = m_scene; |
2432 | 2432 | ||
2433 | float terrainHeight = (float)targetScene.Heightmap[(int)(pos.X % Constants.RegionSize), (int)(pos.Y % Constants.RegionSize)]; | 2433 | float terrainHeight = (float)targetScene.Heightmap[(int)(pos.X % Constants.RegionSize), (int)(pos.Y % Constants.RegionSize)]; |
2434 | // dont try to land underground | ||
2435 | terrainHeight += Appearance.AvatarHeight / 2; | ||
2434 | pos.Z = Math.Max(terrainHeight, pos.Z); | 2436 | pos.Z = Math.Max(terrainHeight, pos.Z); |
2435 | 2437 | ||
2436 | // Fudge factor. It appears that if one clicks "go here" on a piece of ground, the go here request is | 2438 | // 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 | |||
2442 | // m_log.DebugFormat( | 2444 | // m_log.DebugFormat( |
2443 | // "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}", | 2445 | // "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}", |
2444 | // Name, pos, terrainHeight, m_scene.RegionInfo.RegionName); | 2446 | // Name, pos, terrainHeight, m_scene.RegionInfo.RegionName); |
2447 | |||
2445 | 2448 | ||
2446 | if (noFly) | 2449 | if (noFly) |
2447 | Flying = false; | 2450 | Flying = false; |
2448 | else if (pos.Z > terrainHeight) | 2451 | else if (pos.Z > terrainHeight + Appearance.AvatarHeight / 2 || Flying) |
2449 | Flying = true; | 2452 | Flying = true; |
2450 | 2453 | ||
2451 | LandAtTarget = landAtTarget; | 2454 | LandAtTarget = landAtTarget; |