sog DelinkFromGroup: change order of some operations

master
UbitUmarov 2020-02-21 19:15:08 +00:00
parent 60a924f3c6
commit c887446b7e
2 changed files with 15 additions and 10 deletions

View File

@ -103,6 +103,13 @@ namespace OpenSim.Region.Framework.Scenes
Array.ForEach<SceneObjectPart>(m_parts.GetArray(), p => p.Inventory.StopScriptInstances());
}
public void SendReleaseScriptsControl()
{
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
parts[i].Inventory.SendReleaseScriptsControl();
}
public void RemoveScriptsPermissions(int permissions)
{
SceneObjectPart[] parts = m_parts.GetArray();

View File

@ -3414,13 +3414,15 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.setGroupPosition(worldPos);
linkPart.setOffsetPosition(Vector3.Zero);
linkPart.setRotationOffset(worldRot);
linkPart.Rezzed = RootPart.Rezzed;
// Create a new SOG to go around this unlinked and unattached SOP
SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart);
InvalidBoundsRadius();
InvalidatePartsLinkMaps();
objectGroup.InvalidateEffectivePerms();
m_scene.AddNewSceneObject(objectGroup, true);
linkPart.Rezzed = RootPart.Rezzed;
objectGroup.HasGroupChangedDueToDelink = true;
// When we delete a group, we currently have to force persist to the database if the object id has changed
// (since delete works by deleting all rows which have a given object id)
@ -3429,15 +3431,11 @@ namespace OpenSim.Region.Framework.Scenes
if (linkPart.PhysicsShapeType == (byte)PhysShapeType.none)
linkPart.PhysicsShapeType = linkPart.DefaultPhysicsShapeType(); // root prims can't have type none for now
m_scene.AddNewSceneObject(objectGroup, true);
if (m_rootPart.PhysActor != null)
m_rootPart.PhysActor.Building = false;
objectGroup.HasGroupChangedDueToDelink = true;
InvalidBoundsRadius();
InvalidatePartsLinkMaps();
objectGroup.InvalidateEffectivePerms();
if (sendEvents)
linkPart.TriggerScriptChangedEvent(Changed.LINK);