more on scripts *target* events

This commit is contained in:
UbitUmarov
2020-02-26 19:18:07 +00:00
parent 94f88e330b
commit ad5aff2d17
5 changed files with 37 additions and 21 deletions

View File

@@ -3011,20 +3011,24 @@ namespace OpenSim.Region.Framework.Scenes
public void RemoveScriptEvents(UUID scriptid)
{
if (ParentGroup != null)
ParentGroup.RemoveScriptTargets(scriptid);
lock (m_scriptEvents)
{
if (m_scriptEvents.TryGetValue(scriptid, out scriptEvents ev))
{
if((ev & (scriptEvents.anyTarget)) != 0 && ParentGroup != null)
ParentGroup.RemoveScriptTargets(scriptid);
m_scriptEvents.Remove(scriptid);
aggregateScriptEvents();
}
}
}
public void RemoveScriptTargets(UUID scriptid)
{
if(ParentGroup != null)
ParentGroup.RemoveScriptTargets(scriptid);
}
/// <summary>
/// Reset UUIDs for this part. This involves generate this part's own UUID and
/// generating new UUIDs for all the items in the inventory.
@@ -4001,10 +4005,6 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE OBJECT PART]: Set script events for script with id {0} on {1}/{2} to {3} in {4}",
// scriptid, Name, ParentGroup.Name, events, ParentGroup.Scene.Name);
// scriptEvents oldparts;
if (ParentGroup != null)
ParentGroup.RemoveScriptTargets(scriptid);
lock (m_scriptEvents)
{
if (m_scriptEvents.TryGetValue(scriptid, out scriptEvents ev))