Guard against Scene being null in attachments it the wearing avatar is in the process of logging out.

avinationmerge
Melanie Thielker 2014-03-25 03:17:44 +01:00
parent 075cf2baa3
commit a30ad71651
1 changed files with 18 additions and 16 deletions

View File

@ -1886,25 +1886,27 @@ namespace OpenSim.Region.Framework.Scenes
{ {
SceneObjectPart part = parts[i]; SceneObjectPart part = parts[i];
Scene.ForEachRootScenePresence(delegate(ScenePresence avatar) if (Scene != null)
{ {
if (avatar.ParentID == LocalId) Scene.ForEachRootScenePresence(delegate(ScenePresence avatar)
avatar.StandUp();
if (!silent)
{ {
part.ClearUpdateSchedule(); if (avatar.ParentID == LocalId)
if (part == m_rootPart) avatar.StandUp();
{
if (!IsAttachment
|| AttachedAvatar == avatar.ControllingClient.AgentId
|| !HasPrivateAttachmentPoint)
avatar.ControllingClient.SendKillObject(m_regionHandle, new List<uint> { part.LocalId });
}
}
});
}
if (!silent)
{
part.ClearUpdateSchedule();
if (part == m_rootPart)
{
if (!IsAttachment
|| AttachedAvatar == avatar.ControllingClient.AgentId
|| !HasPrivateAttachmentPoint)
avatar.ControllingClient.SendKillObject(m_regionHandle, new List<uint> { part.LocalId });
}
}
});
}
}
} }
public void AddScriptLPS(int count) public void AddScriptLPS(int count)