From 5d6c9644faf6aeac38410af9cff97adfef88d7aa Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 10 Aug 2011 01:47:37 +0100 Subject: early code to allow scripts to force npcs not to fly when moving to target this is to allow walking on prims. it will be up to the script writer to be sure that there is a continuous path. currently implemented in osNpcMoveToTarget(), but none of this is final. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (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 2db83eb..b8e4e93 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1684,7 +1684,12 @@ namespace OpenSim.Region.Framework.Scenes /// Move to the given target over time. /// /// - public void MoveToTarget(Vector3 pos) + /// + /// If true, then don't allow the avatar to fly to the target, even if it's up in the air. + /// 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) { // m_log.DebugFormat( // "[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}", @@ -1718,7 +1723,7 @@ namespace OpenSim.Region.Framework.Scenes "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}", Name, pos, terrainHeight, m_scene.RegionInfo.RegionName); - if (pos.Z > terrainHeight) + if (!noFly && pos.Z > terrainHeight) PhysicsActor.Flying = true; MovingToTarget = true; -- cgit v1.1