diff --git a/prebuild.xml b/prebuild.xml index a49a048..969ef3e 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -22,6 +22,7 @@ + diff --git a/src/BasicPathFinding.cs b/src/BasicPathFinding.cs index 74181c2..e6430f4 100644 --- a/src/BasicPathFinding.cs +++ b/src/BasicPathFinding.cs @@ -5,6 +5,7 @@ using OpenMetaverse; using OpenSim.Region.CoreModules.World.LegacyMap; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.ScriptEngine.Interfaces; using OpenSim.Region.ScriptEngine.Shared.Api; using System; using System.Collections.Generic; @@ -35,6 +36,7 @@ namespace OpenSim.Modules.PathFinding private string m_dataDirectory = "./PathFindingData"; private IScriptModuleComms m_scriptModule; private AsyncCommandManager m_asyncCommands = null; + private IScriptEngine m_scriptEngine = null; public string Name { @@ -114,6 +116,13 @@ namespace OpenSim.Modules.PathFinding m_log.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message); m_enabled = false; } + + m_scriptEngine = m_scene.RequestModuleInterface(); + + if(m_scriptEngine != null) + { + m_asyncCommands = new AsyncCommandManager(m_scriptEngine); + } } } @@ -216,7 +225,7 @@ namespace OpenSim.Modules.PathFinding { SceneObjectPart _host = m_scene.GetSceneObjectPart(hostID); - if(_host != null) + if(_host != null || m_asyncCommands != null) { String imageName = UUID.Random().ToString(); @@ -226,6 +235,14 @@ namespace OpenSim.Modules.PathFinding return imageName; } + else + { + if (_host == null) + m_log.ErrorFormat("[" + Name + "]: Host is null"); + + if (m_asyncCommands == null) + m_log.ErrorFormat("[" + Name + "]: AsyncCommands is null"); + } return UUID.Zero.ToString();