Reorder checks in SP.CompleteMovement() to fix test failures

master-beforevarregion
Justin Clark-Casey (justincc) 2014-01-16 23:44:17 +00:00
parent f467121c51
commit 4fa843ff19
1 changed files with 35 additions and 38 deletions

View File

@ -1003,49 +1003,46 @@ namespace OpenSim.Region.Framework.Scenes
/// </remarks> /// </remarks>
private bool MakeRootAgent(Vector3 pos, bool isFlying) private bool MakeRootAgent(Vector3 pos, bool isFlying)
{ {
// m_log.InfoFormat(
// "[SCENE]: Upgrading child to root agent for {0} in {1}",
// Name, m_scene.RegionInfo.RegionName);
if (ParentUUID != UUID.Zero)
{
m_log.DebugFormat("[SCENE PRESENCE]: Sitting avatar back on prim {0}", ParentUUID);
SceneObjectPart part = m_scene.GetSceneObjectPart(ParentUUID);
if (part == null)
{
m_log.ErrorFormat("[SCENE PRESENCE]: Can't find prim {0} to sit on", ParentUUID);
}
else
{
part.ParentGroup.AddAvatar(UUID);
if (part.SitTargetPosition != Vector3.Zero)
part.SitTargetAvatar = UUID;
// ParentPosition = part.GetWorldPosition();
ParentID = part.LocalId;
ParentPart = part;
m_pos = PrevSitOffset;
// pos = ParentPosition;
pos = part.GetWorldPosition();
}
ParentUUID = UUID.Zero;
IsChildAgent = false;
// Animator.TrySetMovementAnimation("SIT");
}
else
{
IsChildAgent = false;
IsLoggingIn = false;
}
//m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count);
lock (m_completeMovementLock) lock (m_completeMovementLock)
{ {
if (!IsChildAgent) if (!IsChildAgent)
return false; return false;
//m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count);
// m_log.InfoFormat(
// "[SCENE]: Upgrading child to root agent for {0} in {1}",
// Name, m_scene.RegionInfo.RegionName);
if (ParentUUID != UUID.Zero)
{
m_log.DebugFormat("[SCENE PRESENCE]: Sitting avatar back on prim {0}", ParentUUID);
SceneObjectPart part = m_scene.GetSceneObjectPart(ParentUUID);
if (part == null)
{
m_log.ErrorFormat("[SCENE PRESENCE]: Can't find prim {0} to sit on", ParentUUID);
}
else
{
part.ParentGroup.AddAvatar(UUID);
if (part.SitTargetPosition != Vector3.Zero)
part.SitTargetAvatar = UUID;
// ParentPosition = part.GetWorldPosition();
ParentID = part.LocalId;
ParentPart = part;
m_pos = PrevSitOffset;
// pos = ParentPosition;
pos = part.GetWorldPosition();
}
ParentUUID = UUID.Zero;
// Animator.TrySetMovementAnimation("SIT");
}
else
{
IsLoggingIn = false;
}
IsChildAgent = false; IsChildAgent = false;
} }