From b454326273a03420addf4d73d308f0ca773558ad Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 9 Mar 2012 02:33:48 +0000 Subject: refactor: cleanup SP.HandleAgentSit so that everything is done within one if (part != null), rather than having unnecessary multiple checks --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index be56fe1..c9dc7fd 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2204,23 +2204,16 @@ namespace OpenSim.Region.Framework.Scenes // "[SCENE PRESENCE]: Sitting {0} at position {1} ({2} + {3}) on part {4} {5} without sit target", // Name, part.AbsolutePosition, m_pos, ParentPosition, part.Name, part.LocalId); } - } - else - { - return; - } - - ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); - if (ParentPart == null) - return; - ParentID = m_requestedSitTargetID; + ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); + ParentID = m_requestedSitTargetID; - Velocity = Vector3.Zero; - RemoveFromPhysicalScene(); - - Animator.TrySetMovementAnimation(sitAnimation); - SendAvatarDataToAllAgents(); + Velocity = Vector3.Zero; + RemoveFromPhysicalScene(); + + Animator.TrySetMovementAnimation(sitAnimation); + SendAvatarDataToAllAgents(); + } } public void HandleAgentSitOnGround() -- cgit v1.1