aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorUbitUmarov2014-07-21 21:31:48 +0100
committerUbitUmarov2014-07-21 21:31:48 +0100
commit5cdd205ee7f3f785d9d6dd6eca1fcfb8e414313b (patch)
tree8a0b3f0fec99fd80658a9e032fade7d567f62db7 /OpenSim/Region/Framework
parent change ava to ava collisions a bit (diff)
downloadopensim-SC-5cdd205ee7f3f785d9d6dd6eca1fcfb8e414313b.zip
opensim-SC-5cdd205ee7f3f785d9d6dd6eca1fcfb8e414313b.tar.gz
opensim-SC-5cdd205ee7f3f785d9d6dd6eca1fcfb8e414313b.tar.bz2
opensim-SC-5cdd205ee7f3f785d9d6dd6eca1fcfb8e414313b.tar.xz
change presence movetotarget avoiding trying to go undergroud or fly when
it can walk. ( still needs better code )
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs5
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;