From d358125cac4e01194dae4b1f0bc9afc87e463f76 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 22 Sep 2011 00:16:05 +0100
Subject: Reinstate option to land an npc when it reaches a target.
This is moved into ScenePresence for now as a general facility
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
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
public bool MovingToTarget { get; private set; }
public Vector3 MoveToPositionTarget { get; private set; }
+ ///
+ /// Controls whether an avatar automatically moving to a target will land when it gets there (if flying).
+ ///
+ public bool LandAtTarget { get; private set; }
+
private bool m_followCamAuto;
private int m_movementUpdateCount;
@@ -1681,7 +1686,10 @@ namespace OpenSim.Region.Framework.Scenes
/// This is to allow movement to targets that are known to be on an elevated platform with a continuous path
/// from start to finish.
///
- public void MoveToTarget(Vector3 pos, bool noFly)
+ ///
+ /// If true and the avatar starts flying during the move then land at the target.
+ ///
+ public void MoveToTarget(Vector3 pos, bool noFly, bool landAtTarget)
{
m_log.DebugFormat(
"[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}",
@@ -1720,6 +1728,7 @@ namespace OpenSim.Region.Framework.Scenes
else if (pos.Z > terrainHeight)
PhysicsActor.Flying = true;
+ LandAtTarget = landAtTarget;
MovingToTarget = true;
MoveToPositionTarget = pos;
--
cgit v1.1