Hold a ref to the prim we're sat on rather than querying scene each time

the check for significant is carried out. Prevents a deadlock condition.
0.7.4.1
Melanie 2012-03-08 18:31:58 +01:00
parent fa2a64564a
commit 675d40357c
1 changed files with 30 additions and 28 deletions

View File

@ -457,16 +457,9 @@ namespace OpenSim.Region.Framework.Scenes
// without the parent rotation applied.
if (ParentID != 0)
{
SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID);
if (part != null)
{
SceneObjectPart part = ParentPart;
return part.AbsolutePosition + (m_pos * part.GetWorldRotation());
}
else
{
return ParentPosition + m_pos;
}
}
}
return m_pos;
}
@ -576,6 +569,13 @@ namespace OpenSim.Region.Framework.Scenes
}
private uint m_parentID;
public SceneObjectPart ParentPart
{
get { return m_parentPart; }
set { m_parentPart = value; }
}
private SceneObjectPart m_parentPart = null;
public float Health
{
get { return m_health; }
@ -1751,9 +1751,7 @@ namespace OpenSim.Region.Framework.Scenes
if (ParentID != 0)
{
SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID);
if (part != null)
{
SceneObjectPart part = ParentPart;
TaskInventoryDictionary taskIDict = part.TaskInventory;
if (taskIDict != null)
{
@ -1775,12 +1773,12 @@ namespace OpenSim.Region.Framework.Scenes
ParentPosition = part.GetWorldPosition();
ControllingClient.SendClearFollowCamProperties(part.ParentUUID);
}
m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight);
ParentPosition = Vector3.Zero;
ParentID = 0;
ParentPart = null;
SendAvatarDataToAllAgents();
m_requestedSitTargetID = 0;
@ -2212,6 +2210,10 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
if (ParentPart == null)
return;
ParentID = m_requestedSitTargetID;
Velocity = Vector3.Zero;