diff options
author | Justin Clark-Casey (justincc) | 2011-08-04 01:00:33 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-04 01:00:33 +0100 |
commit | 7f6f100c5a93791e8af29bafcfb93cfd289d5e8b (patch) | |
tree | f36b5dfbc1414fa2564429dd3f4eec6dc1479201 /OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |
parent | extend npc move test to check a second movement (diff) | |
download | opensim-SC_OLD-7f6f100c5a93791e8af29bafcfb93cfd289d5e8b.zip opensim-SC_OLD-7f6f100c5a93791e8af29bafcfb93cfd289d5e8b.tar.gz opensim-SC_OLD-7f6f100c5a93791e8af29bafcfb93cfd289d5e8b.tar.bz2 opensim-SC_OLD-7f6f100c5a93791e8af29bafcfb93cfd289d5e8b.tar.xz |
When the NPC reaches within the SIGNIFICANT_CLIENT_MOVEMENT distance of the target, move it directly to the target.
This makes the movement exact. Regression test changed to check avatar reaches exact target.
Also has the nice side effect of making NPC animations continue to work after the first movement (which wasn't working). However, avatar still pauses in mid-stride
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index dd94240..fdc3485 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -70,12 +70,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
70 | // presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget, distanceToTarget); | 70 | // presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget, distanceToTarget); |
71 | 71 | ||
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 <= 1) | 73 | if (distanceToTarget <= 2) |
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} {1}", presence.Name, presence.UUID); |
76 | // We are close enough to the target for now | 76 | // We are close enough to the target for now |
77 | presence.ResetMoveToTarget(); | ||
78 | presence.Velocity = Vector3.Zero; | 77 | presence.Velocity = Vector3.Zero; |
78 | presence.AbsolutePosition = presence.MoveToPositionTarget; | ||
79 | presence.ResetMoveToTarget(); | ||
79 | 80 | ||
80 | // FIXME: This doesn't work | 81 | // FIXME: This doesn't work |
81 | if (presence.PhysicsActor.Flying) | 82 | if (presence.PhysicsActor.Flying) |