From fb5014cf5b9d7044aafcf7b11cbddb69a5119649 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 19 Sep 2008 19:07:20 +0000 Subject: * Duh, forgot I had undone some of the changes I meant to include in the previous commit --- .../ScriptEngine/Shared/Instance/ScriptInstance.cs | 17 +++++------------ OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 4 ++-- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 506f0f5..80d7743 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -164,16 +164,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance set { m_StartParam = value; } } - public ScriptInstance(IScriptEngine engine, uint localID, - UUID objectID, UUID itemID, UUID assetID, string assembly, + public ScriptInstance(IScriptEngine engine, SceneObjectPart part, + UUID itemID, UUID assetID, string assembly, AppDomain dom, string primName, string scriptName, int startParam, bool postOnRez, StateSource stateSource, int maxScriptQueue) { m_Engine = engine; - m_LocalID = localID; - m_ObjectID = objectID; + m_LocalID = part.LocalId; + m_ObjectID = part.UUID; m_ItemID = itemID; m_AssetID = assetID; m_PrimName = primName; @@ -184,17 +184,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance ApiManager am = new ApiManager(); - SceneObjectPart part=engine.World.GetSceneObjectPart(localID); - if (part == null) - { - engine.Log.Error("[Script] SceneObjectPart unavailable. Script NOT started."); - return; - } - foreach (string api in am.GetApis()) { m_Apis[api] = am.CreateApi(api); - m_Apis[api].Initialize(engine, part, localID, itemID); + m_Apis[api].Initialize(engine, part, m_LocalID, itemID); } try diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 7255de4..caaaf34 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -500,8 +500,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_DomainScripts[appDomain].Add(itemID); ScriptInstance instance = - new ScriptInstance(this, part.LocalId, - part.UUID, itemID, assetID, assembly, + new ScriptInstance(this, part, + itemID, assetID, assembly, m_AppDomains[appDomain], part.ParentGroup.RootPart.Name, item.Name, startParam, postOnRez, -- cgit v1.1