From b0fe0464af9a11dda184d3613eca734cd8c9f21e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 22 Nov 2011 22:13:57 +0000 Subject: Stop an exception being thrown and a teleport/border cross failing if the desintation sim has no active script engines. This involves getting IScene.RequestModuleInterfaces() to return an empty array (as was stated in the method doc) rather than an array containing one null entry. Callers adjusted to stop checking for the list reference being null (which never happened anyway) --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7d901c9..c2d3501 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3525,23 +3525,23 @@ namespace OpenSim.Region.Framework.Scenes /// The arguments for the event public void SendScriptEventToAttachments(string eventName, Object[] args) { - if (m_scriptEngines != null) + if (m_scriptEngines.Length == 0) + return; + + lock (m_attachments) { - lock (m_attachments) + foreach (SceneObjectGroup grp in m_attachments) { - foreach (SceneObjectGroup grp in m_attachments) + // 16384 is CHANGED_ANIMATION + // + // Send this to all attachment root prims + // + foreach (IScriptModule m in m_scriptEngines) { - // 16384 is CHANGED_ANIMATION - // - // Send this to all attachment root prims - // - foreach (IScriptModule m in m_scriptEngines) - { - if (m == null) // No script engine loaded - continue; + if (m == null) // No script engine loaded + continue; - m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION }); - } + m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION }); } } } -- cgit v1.1