mirror of
https://github.com/opensim/opensim.git
synced 2026-06-06 02:55:47 +08:00
add osResetAllScripts(LSL_Integer AllLinkset). use with care
This commit is contained in:
@@ -5560,5 +5560,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
return LSL_Rotation.Slerp(a, b, amount);
|
||||
}
|
||||
|
||||
public void osResetAllScripts(LSL_Integer linkset)
|
||||
{
|
||||
UUID me = m_item.ItemID;
|
||||
List<TaskInventoryItem> scripts = new List<TaskInventoryItem>();
|
||||
|
||||
if(linkset != 0)
|
||||
{
|
||||
SceneObjectGroup sog = m_host.ParentGroup;
|
||||
if(sog.inTransit || sog.IsDeleted)
|
||||
return;
|
||||
|
||||
SceneObjectPart[] parts = sog.Parts;
|
||||
for (int i = 0; i < parts.Length; i++)
|
||||
{
|
||||
scripts.AddRange(parts[i].Inventory.GetInventoryItems(InventoryType.LSL));
|
||||
}
|
||||
}
|
||||
else
|
||||
scripts.AddRange(m_host.Inventory.GetInventoryItems(InventoryType.LSL));
|
||||
|
||||
foreach(TaskInventoryItem script in scripts)
|
||||
{
|
||||
if(script.ItemID == me)
|
||||
continue;
|
||||
m_ScriptEngine.ResetScript(script.ItemID);
|
||||
}
|
||||
|
||||
if (m_UrlModule != null)
|
||||
m_UrlModule.ScriptRemoved(me);
|
||||
|
||||
m_ScriptEngine.ApiResetScript(me);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -556,5 +556,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
LSL_Key osGetLastChangedEventKey();
|
||||
LSL_Float osGetPSTWallclock();
|
||||
LSL_Rotation osSlerp(LSL_Rotation a, LSL_Rotation b, LSL_Float amount);
|
||||
|
||||
void osResetAllScripts(LSL_Integer AllLinkset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
public partial class ScriptBaseClass
|
||||
{
|
||||
// SCRIPTS CONSTANTS
|
||||
public static readonly LSLInteger OS_APIVERSION = 8;
|
||||
public static readonly LSLInteger OS_APIVERSION = 9;
|
||||
|
||||
public static readonly LSLInteger TRUE = 1;
|
||||
public static readonly LSLInteger FALSE = 0;
|
||||
|
||||
@@ -1412,5 +1412,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
return m_OSSL_Functions.osSlerp(a, b, amount);
|
||||
}
|
||||
|
||||
public void osResetAllScripts(LSL_Integer allLinkSet)
|
||||
{
|
||||
m_OSSL_Functions.osResetAllScripts(allLinkSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user