mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/TaskInventoryItem.cs OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
This commit is contained in:
@@ -244,31 +244,52 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (m_part == null || m_part.ParentGroup == null || m_part.ParentGroup.Scene == null)
|
||||
return;
|
||||
|
||||
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
|
||||
if (engines == null) // No engine at all
|
||||
return;
|
||||
|
||||
Items.LockItemsForRead(true);
|
||||
foreach (TaskInventoryItem item in Items.Values)
|
||||
{
|
||||
if (item.InvType == (int)InventoryType.LSL)
|
||||
{
|
||||
foreach (IScriptModule e in engines)
|
||||
{
|
||||
bool running;
|
||||
|
||||
if (e.HasScript(item.ItemID, out running))
|
||||
{
|
||||
item.ScriptRunning = running;
|
||||
break;
|
||||
}
|
||||
}
|
||||
bool running;
|
||||
if (TryGetScriptInstanceRunning(m_part.ParentGroup.Scene, item, out running))
|
||||
item.ScriptRunning = running;
|
||||
}
|
||||
}
|
||||
|
||||
Items.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
public bool TryGetScriptInstanceRunning(UUID itemId, out bool running)
|
||||
{
|
||||
running = false;
|
||||
|
||||
TaskInventoryItem item = GetInventoryItem(itemId);
|
||||
|
||||
if (item == null)
|
||||
return false;
|
||||
|
||||
return TryGetScriptInstanceRunning(m_part.ParentGroup.Scene, item, out running);
|
||||
}
|
||||
|
||||
public static bool TryGetScriptInstanceRunning(Scene scene, TaskInventoryItem item, out bool running)
|
||||
{
|
||||
running = false;
|
||||
|
||||
if (item.InvType != (int)InventoryType.LSL)
|
||||
return false;
|
||||
|
||||
IScriptModule[] engines = scene.RequestModuleInterfaces<IScriptModule>();
|
||||
if (engines == null) // No engine at all
|
||||
return false;
|
||||
|
||||
foreach (IScriptModule e in engines)
|
||||
{
|
||||
if (e.HasScript(item.ItemID, out running))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public int CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource)
|
||||
{
|
||||
int scriptsValidForStarting = 0;
|
||||
|
||||
Reference in New Issue
Block a user