diff options
author | Justin Clark-Casey (justincc) | 2011-09-22 00:16:05 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-09-22 00:16:05 +0100 |
commit | d358125cac4e01194dae4b1f0bc9afc87e463f76 (patch) | |
tree | 28e06b311c9bd1621e94305aa9da6b32eef8502c /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | Move code which handles NPC movement into Scene so that this can also be used... (diff) | |
download | opensim-SC_OLD-d358125cac4e01194dae4b1f0bc9afc87e463f76.zip opensim-SC_OLD-d358125cac4e01194dae4b1f0bc9afc87e463f76.tar.gz opensim-SC_OLD-d358125cac4e01194dae4b1f0bc9afc87e463f76.tar.bz2 opensim-SC_OLD-d358125cac4e01194dae4b1f0bc9afc87e463f76.tar.xz |
Reinstate option to land an npc when it reaches a target.
This is moved into ScenePresence for now as a general facility
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 82d9abf..a7b189b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -220,6 +220,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
220 | public bool MovingToTarget { get; private set; } | 220 | public bool MovingToTarget { get; private set; } |
221 | public Vector3 MoveToPositionTarget { get; private set; } | 221 | public Vector3 MoveToPositionTarget { get; private set; } |
222 | 222 | ||
223 | /// <summary> | ||
224 | /// Controls whether an avatar automatically moving to a target will land when it gets there (if flying). | ||
225 | /// </summary> | ||
226 | public bool LandAtTarget { get; private set; } | ||
227 | |||
223 | private bool m_followCamAuto; | 228 | private bool m_followCamAuto; |
224 | 229 | ||
225 | private int m_movementUpdateCount; | 230 | private int m_movementUpdateCount; |
@@ -1681,7 +1686,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1681 | /// This is to allow movement to targets that are known to be on an elevated platform with a continuous path | 1686 | /// This is to allow movement to targets that are known to be on an elevated platform with a continuous path |
1682 | /// from start to finish. | 1687 | /// from start to finish. |
1683 | /// </param> | 1688 | /// </param> |
1684 | public void MoveToTarget(Vector3 pos, bool noFly) | 1689 | /// <param name="landAtTarget"> |
1690 | /// If true and the avatar starts flying during the move then land at the target. | ||
1691 | /// </param> | ||
1692 | public void MoveToTarget(Vector3 pos, bool noFly, bool landAtTarget) | ||
1685 | { | 1693 | { |
1686 | m_log.DebugFormat( | 1694 | m_log.DebugFormat( |
1687 | "[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}", | 1695 | "[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}", |
@@ -1720,6 +1728,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1720 | else if (pos.Z > terrainHeight) | 1728 | else if (pos.Z > terrainHeight) |
1721 | PhysicsActor.Flying = true; | 1729 | PhysicsActor.Flying = true; |
1722 | 1730 | ||
1731 | LandAtTarget = landAtTarget; | ||
1723 | MovingToTarget = true; | 1732 | MovingToTarget = true; |
1724 | MoveToPositionTarget = pos; | 1733 | MoveToPositionTarget = pos; |
1725 | 1734 | ||