diff options
author | Justin Clark-Casey (justincc) | 2012-03-09 02:33:48 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-03-09 02:33:48 +0000 |
commit | b454326273a03420addf4d73d308f0ca773558ad (patch) | |
tree | 85bf914fd6a339ca9e566cf1b5172fefbf493550 /OpenSim/Region/Framework | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-b454326273a03420addf4d73d308f0ca773558ad.zip opensim-SC_OLD-b454326273a03420addf4d73d308f0ca773558ad.tar.gz opensim-SC_OLD-b454326273a03420addf4d73d308f0ca773558ad.tar.bz2 opensim-SC_OLD-b454326273a03420addf4d73d308f0ca773558ad.tar.xz |
refactor: cleanup SP.HandleAgentSit so that everything is done within one if (part != null), rather than having unnecessary multiple checks
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 23 |
1 files changed, 8 insertions, 15 deletions
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 | |||
2204 | // "[SCENE PRESENCE]: Sitting {0} at position {1} ({2} + {3}) on part {4} {5} without sit target", | 2204 | // "[SCENE PRESENCE]: Sitting {0} at position {1} ({2} + {3}) on part {4} {5} without sit target", |
2205 | // Name, part.AbsolutePosition, m_pos, ParentPosition, part.Name, part.LocalId); | 2205 | // Name, part.AbsolutePosition, m_pos, ParentPosition, part.Name, part.LocalId); |
2206 | } | 2206 | } |
2207 | } | ||
2208 | else | ||
2209 | { | ||
2210 | return; | ||
2211 | } | ||
2212 | |||
2213 | ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); | ||
2214 | if (ParentPart == null) | ||
2215 | return; | ||
2216 | 2207 | ||
2217 | ParentID = m_requestedSitTargetID; | 2208 | ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); |
2209 | ParentID = m_requestedSitTargetID; | ||
2218 | 2210 | ||
2219 | Velocity = Vector3.Zero; | 2211 | Velocity = Vector3.Zero; |
2220 | RemoveFromPhysicalScene(); | 2212 | RemoveFromPhysicalScene(); |
2221 | 2213 | ||
2222 | Animator.TrySetMovementAnimation(sitAnimation); | 2214 | Animator.TrySetMovementAnimation(sitAnimation); |
2223 | SendAvatarDataToAllAgents(); | 2215 | SendAvatarDataToAllAgents(); |
2216 | } | ||
2224 | } | 2217 | } |
2225 | 2218 | ||
2226 | public void HandleAgentSitOnGround() | 2219 | public void HandleAgentSitOnGround() |