aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World/NPC
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-04 02:31:40 +0100
committerJustin Clark-Casey (justincc)2011-08-04 02:31:40 +0100
commit54ce0293423b4286fe62cbadc3b1441cae5f78eb (patch)
tree4987da36ba6a80778ded16c2c9f6a7c5dfd189eb /OpenSim/Region/OptionalModules/World/NPC
parentminor: remove some mono compiler warnings (diff)
downloadopensim-SC_OLD-54ce0293423b4286fe62cbadc3b1441cae5f78eb.zip
opensim-SC_OLD-54ce0293423b4286fe62cbadc3b1441cae5f78eb.tar.gz
opensim-SC_OLD-54ce0293423b4286fe62cbadc3b1441cae5f78eb.tar.bz2
opensim-SC_OLD-54ce0293423b4286fe62cbadc3b1441cae5f78eb.tar.xz
if an NPC move to target is above the terrain then make it fly to destination
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/NPC')
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs10
1 files changed, 7 insertions, 3 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 2215495..30e81fc 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -62,7 +62,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
62 { 62 {
63 lock (m_avatars) 63 lock (m_avatars)
64 { 64 {
65 if (m_avatars.ContainsKey(presence.UUID)) 65 if (m_avatars.ContainsKey(presence.UUID) && presence.MovingToTarget)
66 { 66 {
67 double distanceToTarget = Util.GetDistanceTo(presence.AbsolutePosition, presence.MoveToPositionTarget); 67 double distanceToTarget = Util.GetDistanceTo(presence.AbsolutePosition, presence.MoveToPositionTarget);
68// m_log.DebugFormat( 68// m_log.DebugFormat(
@@ -72,8 +72,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
72 // Check the error term of the current position in relation to the target position 72 // Check the error term of the current position in relation to the target position
73 if (distanceToTarget <= ScenePresence.SIGNIFICANT_MOVEMENT) 73 if (distanceToTarget <= ScenePresence.SIGNIFICANT_MOVEMENT)
74 { 74 {
75// m_log.DebugFormat("[NPC MODULE]: Stopping movement of npc {0} {1}", presence.Name, presence.UUID); 75 m_log.DebugFormat("[NPC MODULE]: Stopping movement of npc {0}", presence.Name);
76 // We are close enough to the target for now 76 // We are close enough to the target
77 presence.Velocity = Vector3.Zero; 77 presence.Velocity = Vector3.Zero;
78 presence.AbsolutePosition = presence.MoveToPositionTarget; 78 presence.AbsolutePosition = presence.MoveToPositionTarget;
79 presence.ResetMoveToTarget(); 79 presence.ResetMoveToTarget();
@@ -86,6 +86,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
86 } 86 }
87 else 87 else
88 { 88 {
89 m_log.DebugFormat(
90 "[NPC MODULE]: Updating npc {0} at {1} for next movement to {2}",
91 presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget);
92
89 Vector3 agent_control_v3 = new Vector3(); 93 Vector3 agent_control_v3 = new Vector3();
90 presence.HandleMoveToTargetUpdate(ref agent_control_v3, presence.Rotation); 94 presence.HandleMoveToTargetUpdate(ref agent_control_v3, presence.Rotation);
91 presence.AddNewMovement(agent_control_v3, presence.Rotation); 95 presence.AddNewMovement(agent_control_v3, presence.Rotation);