aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-10 01:47:37 +0100
committerJustin Clark-Casey (justincc)2011-08-10 01:47:37 +0100
commit5d6c9644faf6aeac38410af9cff97adfef88d7aa (patch)
tree4913309153fd8b55f7cd5cd27bd449f9eecd41f5 /OpenSim/Region/Framework
parentStop trying to deregister caps or close child agents when an NPC is removed (diff)
downloadopensim-SC-5d6c9644faf6aeac38410af9cff97adfef88d7aa.zip
opensim-SC-5d6c9644faf6aeac38410af9cff97adfef88d7aa.tar.gz
opensim-SC-5d6c9644faf6aeac38410af9cff97adfef88d7aa.tar.bz2
opensim-SC-5d6c9644faf6aeac38410af9cff97adfef88d7aa.tar.xz
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.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Interfaces/INPCModule.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs9
3 files changed, 13 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
index 763d2dc..06296c9 100644
--- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
@@ -67,8 +67,12 @@ namespace OpenSim.Region.Framework.Interfaces
67 /// <param name="agentID">The UUID of the NPC</param> 67 /// <param name="agentID">The UUID of the NPC</param>
68 /// <param name="scene"></param> 68 /// <param name="scene"></param>
69 /// <param name="pos"></param> 69 /// <param name="pos"></param>
70 /// <param name="noFly">
71 /// If true, then the avatar will attempt to walk to the location even if it's up in the air.
72 /// This is to allow walking on prims.
73 /// </param>
70 /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns> 74 /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
71 bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos); 75 bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly);
72 76
73 /// <summary> 77 /// <summary>
74 /// Stop the NPC's current movement. 78 /// Stop the NPC's current movement.
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 3b6a458..fe96152 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1650,7 +1650,7 @@ namespace OpenSim.Region.Framework.Scenes
1650 ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); 1650 ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
1651 if (avatar != null) 1651 if (avatar != null)
1652 { 1652 {
1653 avatar.MoveToTarget(target); 1653 avatar.MoveToTarget(target, false);
1654 } 1654 }
1655 } 1655 }
1656 else 1656 else
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
1684 /// Move to the given target over time. 1684 /// Move to the given target over time.
1685 /// </summary> 1685 /// </summary>
1686 /// <param name="pos"></param> 1686 /// <param name="pos"></param>
1687 public void MoveToTarget(Vector3 pos) 1687 /// <param name="noFly">
1688 /// If true, then don't allow the avatar to fly to the target, even if it's up in the air.
1689 /// This is to allow movement to targets that are known to be on an elevated platform with a continuous path
1690 /// from start to finish.
1691 /// </param>
1692 public void MoveToTarget(Vector3 pos, bool noFly)
1688 { 1693 {
1689// m_log.DebugFormat( 1694// m_log.DebugFormat(
1690// "[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}",
@@ -1718,7 +1723,7 @@ namespace OpenSim.Region.Framework.Scenes
1718 "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}", 1723 "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}",
1719 Name, pos, terrainHeight, m_scene.RegionInfo.RegionName); 1724 Name, pos, terrainHeight, m_scene.RegionInfo.RegionName);
1720 1725
1721 if (pos.Z > terrainHeight) 1726 if (!noFly && pos.Z > terrainHeight)
1722 PhysicsActor.Flying = true; 1727 PhysicsActor.Flying = true;
1723 1728
1724 MovingToTarget = true; 1729 MovingToTarget = true;