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.
parent
095066b1ce
commit
cec8e6d0f7
|
@ -353,6 +353,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||||
// Position of a sensor in a child prim attached to an avatar
|
// Position of a sensor in a child prim attached to an avatar
|
||||||
// will be still wrong.
|
// will be still wrong.
|
||||||
ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
|
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;
|
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
|
// Position of a sensor in a child prim attached to an avatar
|
||||||
// will be still wrong.
|
// will be still wrong.
|
||||||
ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
|
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;
|
q = avatar.GetWorldRotation() * q;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue