diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 0da2c2e5a1..8cd62a7999 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs @@ -103,6 +103,13 @@ namespace OpenSim.Region.Framework.Scenes Array.ForEach(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(); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index efb0317275..e9d8303c23 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -3414,30 +3414,28 @@ 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) // 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 + 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);