mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
refactor: cleanup SP.HandleAgentSit so that everything is done within one if (part != null), rather than having unnecessary multiple checks
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
|
||||
ParentID = m_requestedSitTargetID;
|
||||
|
||||
Velocity = Vector3.Zero;
|
||||
RemoveFromPhysicalScene();
|
||||
|
||||
Animator.TrySetMovementAnimation(sitAnimation);
|
||||
SendAvatarDataToAllAgents();
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
|
||||
if (ParentPart == null)
|
||||
return;
|
||||
|
||||
ParentID = m_requestedSitTargetID;
|
||||
|
||||
Velocity = Vector3.Zero;
|
||||
RemoveFromPhysicalScene();
|
||||
|
||||
Animator.TrySetMovementAnimation(sitAnimation);
|
||||
SendAvatarDataToAllAgents();
|
||||
}
|
||||
|
||||
public void HandleAgentSitOnGround()
|
||||
|
||||
Reference in New Issue
Block a user