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()); 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) public void RemoveScriptsPermissions(int permissions)
{ {
SceneObjectPart[] parts = m_parts.GetArray(); SceneObjectPart[] parts = m_parts.GetArray();

View File

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