diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 5a7dda5f4b..efd682fa42 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -516,6 +516,20 @@ namespace OpenSim.Region.Environment.Scenes public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) { EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient); + + foreach (EntityBase ent in Entities.Values) + { + if (ent is SceneObjectGroup) + { + SceneObjectGroup obj = ent as SceneObjectGroup; + + if( obj.HasChildPrim( localID ) ) + { + obj.ObjectGrabHandler(localID, offsetPos, remoteClient); + return; + } + } + } } } } \ No newline at end of file diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs index a5d8667837..8e8e9a74a1 100644 --- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs +++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs @@ -133,7 +133,9 @@ namespace OpenSim.Region.Environment.Scenes public void TriggerObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) { if (OnObjectGrab != null) + { OnObjectGrab(localID, offsetPos, remoteClient); + } } public void TriggerRezScript(uint localID, LLUUID itemID, string script) diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs index 1f62c889d5..e4b033d496 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs @@ -41,27 +41,6 @@ namespace SimpleApp this.CreateTerrainTexture(); } - public override void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) - { - foreach (EntityBase ent in Entities.Values) - { - if (ent is SceneObjectGroup) - { - SceneObjectGroup obj = ent as SceneObjectGroup; - - if( obj.HasChildPrim( localID ) ) - { - obj.ObjectGrabHandler(localID, offsetPos, remoteClient); - return; - } - } - } - - base.ProcessObjectGrab(localID, offsetPos, remoteClient); - } - - #region IWorld Members - override public void AddNewClient(IClientAPI client, bool child) { SubscribeToClientEvents(client); @@ -79,7 +58,5 @@ namespace SimpleApp client.SendRegionHandshake(m_regInfo); } - - #endregion } } diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs index d4f032723c..ef0ddff9de 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs @@ -52,9 +52,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine // Hook up a test event to our test form myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events"); - myScriptEngine.World.EventManager.OnObjectGrab += new OpenSim.Region.Environment.Scenes.EventManager.ObjectGrabDelegate(touch_start); - myScriptEngine.World.EventManager.OnRezScript += new OpenSim.Region.Environment.Scenes.EventManager.NewRezScript(OnRezScript); - myScriptEngine.World.EventManager.OnRemoveScript += new OpenSim.Region.Environment.Scenes.EventManager.RemoveScript(OnRemoveScript); + myScriptEngine.World.EventManager.OnObjectGrab += touch_start; + myScriptEngine.World.EventManager.OnRezScript += OnRezScript; + myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; }