From 4c1740f7d8e4e577167a84438cce83a7cc32f56d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 1 Feb 2010 20:15:36 +0000 Subject: Actually make EventManager.OnAttach() fire when an object is attached. Previously, only detach was firing! --- OpenSim/Region/Framework/Scenes/EventManager.cs | 5 +++-- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 004ea1f..464ead8 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -313,9 +313,10 @@ namespace OpenSim.Region.Framework.Scenes public event EmptyScriptCompileQueue OnEmptyScriptCompileQueue; /// - /// Called whenever an object is attached, or detached - /// from an in-world presence. + /// Called whenever an object is attached, or detached from an in-world presence. /// + /// If the object is being attached, then the avatarID will be present. If the object is being detached then + /// the avatarID is UUID.Zero (I know, this doesn't make much sense but now it's historical). public delegate void Attach(uint localID, UUID itemID, UUID avatarID); public event Attach OnAttach; diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index fc2798d..1ac061a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -528,6 +528,9 @@ namespace OpenSim.Region.Framework.Scenes // Fire after attach, so we don't get messy perms dialogs // 3 == AttachedRez objatt.CreateScriptInstances(0, true, m_parentScene.DefaultScriptEngine, 3); + + // Do this last so that event listeners have access to all the effects of the attachment + m_parentScene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId); } } -- cgit v1.1