Remove a race condition from SP.Set_AbsolutePosition where we assume the ParentPart is still not null if the ParentID != 0

Another thread could come in and stand the avatar between those two instructions.
0.7.4.1
Justin Clark-Casey (justincc) 2012-03-09 02:22:22 +00:00
parent 42a7a85062
commit 73c47f7205
1 changed files with 5 additions and 5 deletions

View File

@ -455,12 +455,12 @@ namespace OpenSim.Region.Framework.Scenes
// in the sim unless the avatar is on a sit target. While // in the sim unless the avatar is on a sit target. While
// on a sit target, m_pos will contain the desired offset // on a sit target, m_pos will contain the desired offset
// without the parent rotation applied. // without the parent rotation applied.
if (ParentID != 0) SceneObjectPart sitPart = ParentPart;
{
SceneObjectPart part = ParentPart; if (sitPart != null)
return part.AbsolutePosition + (m_pos * part.GetWorldRotation()); return sitPart.AbsolutePosition + (m_pos * sitPart.GetWorldRotation());
}
} }
return m_pos; return m_pos;
} }
set set