From daa66c4811be49a0eee843f2bc77a3465da674de Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 3 Feb 2010 16:40:21 +0000 Subject: add an IsRoot property to sop --- OpenSim/Region/Framework/Scenes/EventManager.cs | 16 +++++++++++++++- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 9 +++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index a4a1abc..c50082d 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -469,7 +469,21 @@ namespace OpenSim.Region.Framework.Scenes { handlerOnAttach = OnAttach; if (handlerOnAttach != null) - handlerOnAttach(localID, itemID, avatarID); + { + foreach (Delegate d in handlerOnAttach.GetInvocationList()) + { + try + { + d(localID, itemID, avatarID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. Error was {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index d7f9bbb..d012d3e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -113,6 +113,15 @@ namespace OpenSim.Region.Framework.Scenes private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + /// + /// Is this sop a root part? + /// + [XmlIgnore] + public bool IsRoot + { + get { return ParentGroup.RootPart == this; } + } + // use only one serializer to give the runtime a chance to optimize it (it won't do that if you // use a new instance every time) private static XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); -- cgit v1.1