diff options
author | Justin Clark-Casey (justincc) | 2011-08-04 01:45:56 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-04 01:45:56 +0100 |
commit | c678b75d65f796f48ae0aacab7325c3aedb0d999 (patch) | |
tree | 7e4b2f2681470aa1fb7b6d5234915b15836e981e /OpenSim/Region/Framework | |
parent | move bAllowUpdateMoveToPosition switch outside of HandleMoveToTargetUpdate() (diff) | |
download | opensim-SC-c678b75d65f796f48ae0aacab7325c3aedb0d999.zip opensim-SC-c678b75d65f796f48ae0aacab7325c3aedb0d999.tar.gz opensim-SC-c678b75d65f796f48ae0aacab7325c3aedb0d999.tar.bz2 opensim-SC-c678b75d65f796f48ae0aacab7325c3aedb0d999.tar.xz |
if a move to target is set underground, constrain it to the terrain height
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 620db94..98e90b9 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1635,7 +1635,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1635 | if (LocalVectorToTarget3D.Y > 0) //MoveLeft | 1635 | if (LocalVectorToTarget3D.Y > 0) //MoveLeft |
1636 | { | 1636 | { |
1637 | m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT; | 1637 | m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT; |
1638 | //AgentControlFlags | ||
1639 | AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT; | 1638 | AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT; |
1640 | updated = true; | 1639 | updated = true; |
1641 | } | 1640 | } |
@@ -1704,6 +1703,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1704 | // pos.Z = AbsolutePosition.Z; | 1703 | // pos.Z = AbsolutePosition.Z; |
1705 | // } | 1704 | // } |
1706 | 1705 | ||
1706 | float terrainHeight = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y]; | ||
1707 | pos.Z = Math.Max(terrainHeight, pos.Z); | ||
1708 | |||
1707 | m_moveToPositionInProgress = true; | 1709 | m_moveToPositionInProgress = true; |
1708 | MoveToPositionTarget = pos; | 1710 | MoveToPositionTarget = pos; |
1709 | 1711 | ||