From d40cdd26496c267b7de4cf7005eb6c933d7ad238 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 3 Jan 2013 02:25:27 +0000 Subject: [PATCH 1/2] cancel MoveToTarget (viewer 'go here") on sits --- .../Region/Framework/Scenes/ScenePresence.cs | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 2a39ffd99e..704bad8f57 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2140,12 +2140,21 @@ namespace OpenSim.Region.Framework.Scenes if (canSit) { + if (PhysicsActor != null) { // We can remove the physicsActor until they stand up. RemoveFromPhysicalScene(); } + if (MovingToTarget) + { + ResetMoveToTarget(); + m_forceToApply = null; + } + + Velocity = Vector3.Zero; + part.AddSittingAvatar(UUID); cameraAtOffset = part.GetCameraAtOffset(); @@ -2230,6 +2239,7 @@ namespace OpenSim.Region.Framework.Scenes return true; } + // not doing autopilot m_requestedSitTargetID = 0; @@ -2259,8 +2269,19 @@ namespace OpenSim.Region.Framework.Scenes // m_log.InfoFormat("physsit {0} {1}", offset.ToString(),Orientation.ToString()); + RemoveFromPhysicalScene(); + + if (MovingToTarget) + { + ResetMoveToTarget(); + m_forceToApply = null; + } + + Velocity = Vector3.Zero; + part.AddSittingAvatar(UUID); + Vector3 cameraAtOffset = part.GetCameraAtOffset(); Vector3 cameraEyeOffset = part.GetCameraEyeOffset(); bool forceMouselook = part.GetForceMouselook(); @@ -2269,8 +2290,6 @@ namespace OpenSim.Region.Framework.Scenes part.UUID, offset, Orientation, false, cameraAtOffset, cameraEyeOffset, forceMouselook); // not using autopilot - Velocity = Vector3.Zero; - RemoveFromPhysicalScene(); Rotation = Orientation; m_pos = offset; @@ -2317,6 +2336,7 @@ namespace OpenSim.Region.Framework.Scenes return; } + if (part.SitTargetAvatar == UUID) { Vector3 sitTargetPos = part.SitTargetPosition; From 1665a0d636a0d4e97000e16bd7a2b482e966c446 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 3 Jan 2013 03:29:40 +0000 Subject: [PATCH 2/2] make ResetMoveToTarget cancel any 'force' waiting to be applied to avatar ( by the odd use of Velocity) --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 704bad8f57..c16c544856 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1990,7 +1990,8 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat("[SCENE PRESENCE]: Resetting move to target for {0}", Name); MovingToTarget = false; - MoveToPositionTarget = Vector3.Zero; +// MoveToPositionTarget = Vector3.Zero; + m_forceToApply = null; // cancel possible last action // We need to reset the control flag as the ScenePresenceAnimator uses this to determine the correct // resting animation (e.g. hover or stand). NPCs don't have a client that will quickly reset this flag. @@ -2148,10 +2149,7 @@ namespace OpenSim.Region.Framework.Scenes } if (MovingToTarget) - { ResetMoveToTarget(); - m_forceToApply = null; - } Velocity = Vector3.Zero; @@ -2272,10 +2270,7 @@ namespace OpenSim.Region.Framework.Scenes RemoveFromPhysicalScene(); if (MovingToTarget) - { ResetMoveToTarget(); - m_forceToApply = null; - } Velocity = Vector3.Zero;