mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
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
This commit is contained in:
@@ -70,12 +70,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget, distanceToTarget);
|
||||
|
||||
// Check the error term of the current position in relation to the target position
|
||||
if (distanceToTarget <= 1)
|
||||
if (distanceToTarget <= 2)
|
||||
{
|
||||
// m_log.DebugFormat("[NPC MODULE]: Stopping movement of npc {0} {1}", presence.Name, presence.UUID);
|
||||
// We are close enough to the target for now
|
||||
presence.ResetMoveToTarget();
|
||||
presence.Velocity = Vector3.Zero;
|
||||
presence.AbsolutePosition = presence.MoveToPositionTarget;
|
||||
presence.ResetMoveToTarget();
|
||||
|
||||
// FIXME: This doesn't work
|
||||
if (presence.PhysicsActor.Flying)
|
||||
|
||||
Reference in New Issue
Block a user