diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index d6aca31582..c2f9fd2445 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -860,6 +860,9 @@ namespace OpenSim.Region.Framework.Scenes /// null if no scene object group containing that prim is found private SceneObjectGroup GetGroupByPrim(uint localID) { + if (Entities.ContainsKey(localID)) + return Entities[localID] as SceneObjectGroup; + //m_log.DebugFormat("Entered GetGroupByPrim with localID {0}", localID); List EntityList = GetEntities(); foreach (EntityBase ent in EntityList) diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index 4734fa9baa..75ec33a2f4 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs @@ -53,10 +53,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule /// private SceneObjectPart GetSOP() { - if (m_rootScene.Entities.ContainsKey(m_localID)) - return ((SceneObjectGroup) m_rootScene.Entities[m_localID]).RootPart; - - return null; + return m_rootScene.GetSceneObjectPart(m_localID); } #region OnTouch diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Test/TestModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Test/TestModule.cs index e56d5ebb3f..702ac745e1 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Test/TestModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Test/TestModule.cs @@ -33,7 +33,18 @@ namespace OpenSim { public override void Start() { - Host.Console.Info("Hello World!"); + // Say Hello + Host.Object.Say("Hello, Avatar!"); + + // Register ourselves to listen + // for touch events. + Host.Object.OnTouch += OnTouched; + } + + // This is our touch event handler + void OnTouched(IObject sender, TouchEventArgs e) + { + Host.Object.Say("Touched."); } public override void Stop()