If a sensor is in an attachment, avoid throwing an exception if the attachee is removed from the scene before we try to retrieve them.

This commit is contained in:
Justin Clark-Casey (justincc)
2013-07-09 23:52:47 +01:00
parent 095066b1ce
commit cec8e6d0f7

View File

@@ -353,6 +353,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
// Position of a sensor in a child prim attached to an avatar
// will be still wrong.
ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
// Don't proceed if the avatar for this attachment has since been removed from the scene.
if (avatar == null)
return sensedEntities;
q = avatar.GetWorldRotation() * q;
}
@@ -480,6 +485,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
// Position of a sensor in a child prim attached to an avatar
// will be still wrong.
ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
// Don't proceed if the avatar for this attachment has since been removed from the scene.
if (avatar == null)
return sensedEntities;
q = avatar.GetWorldRotation() * q;
}