From cabbd187e7945329c2f0700180f400b11096d33c Mon Sep 17 00:00:00 2001 From: meta7 Date: Sat, 7 Aug 2010 11:13:05 -0700 Subject: [PATCH] Fix the distance from which autopilot is negated when sitting on an unscripted prim - and also add some more Velocity code to ensure it gets set to zero in all cases --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 882f4a77d4..56e7e93531 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2007,13 +2007,14 @@ namespace OpenSim.Region.Framework.Scenes if (autopilot) { // its not a scripted sit // if (Util.GetDistanceTo(AbsolutePosition, autopilotTarget) < 4.5) - if( (Math.Abs(AbsolutePosition.X - autopilotTarget.X) < 2.0f) && (Math.Abs(AbsolutePosition.Y - autopilotTarget.Y) < 2.0f) ) + if( (Math.Abs(AbsolutePosition.X - autopilotTarget.X) < 10.0f) && (Math.Abs(AbsolutePosition.Y - autopilotTarget.Y) < 10.0f) ) { autopilot = false; // close enough m_lastWorldPosition = m_pos; /* CW - This give us a position to return the avatar to if the part is killed before standup. Not using the part's position because returning the AV to the last known standing position is likely to be more friendly, isn't it? */ RemoveFromPhysicalScene(); + Velocity = Vector3.Zero; AbsolutePosition = autopilotTarget + new Vector3(0.0f, 0.0f, (m_sitAvatarHeight / 2.0f)); // Warp av to over sit target } // else the autopilot will get us close } @@ -2023,6 +2024,7 @@ namespace OpenSim.Region.Framework.Scenes I *am* using the part's position this time because we have no real idea how far away the avatar is from the sit target. */ RemoveFromPhysicalScene(); + Velocity = Vector3.Zero; } } else return; // physactor is null!