mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
Get NPCs to revert to the correct 'resting' animation (e.g. stand or hover) after finishing their movement. This also fixes judder after an avatar has finished "go here"/autopilot movement in a viewer.
This meant reseting the SP.AgentControlFlags since the Animator uses these to determine the correct default animation.
This commit is contained in:
@@ -95,11 +95,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
// }
|
||||
}
|
||||
|
||||
// FIXME: This doesn't work
|
||||
if (presence.PhysicsActor.Flying)
|
||||
presence.Animator.TrySetMovementAnimation("HOVER");
|
||||
else
|
||||
presence.Animator.TrySetMovementAnimation("STAND");
|
||||
// m_log.DebugFormat(
|
||||
// "[NPC MODULE]: AgentControlFlags {0}, MovementFlag {1} for {2}",
|
||||
// presence.AgentControlFlags, presence.MovementFlag, presence.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -131,6 +131,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||
double distanceToTarget = Util.GetDistanceTo(npc.AbsolutePosition, targetPos);
|
||||
Assert.That(distanceToTarget, Is.LessThan(1), "NPC not within 1 unit of target position on first move");
|
||||
Assert.That(npc.AbsolutePosition, Is.EqualTo(targetPos));
|
||||
Assert.That(npc.AgentControlFlags, Is.EqualTo((uint)AgentManager.ControlFlags.NONE));
|
||||
|
||||
// Try a second movement
|
||||
startPos = npc.AbsolutePosition;
|
||||
|
||||
Reference in New Issue
Block a user