From ea4a526095c7797e3863f540abb8d439dac3f9d3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 22 Sep 2014 16:09:39 +0100 Subject: [PATCH] a few more changes on link/unlink --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 17 +++++++---------- .../Region/Framework/Scenes/SceneObjectGroup.cs | 6 +++--- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index f4ff902374..8a65b06414 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1962,20 +1962,17 @@ namespace OpenSim.Region.Framework.Scenes // slated for unlink, we need to do this // Unlink the remaining set // - bool sendEventsToRemainder = true; - if (numChildren > 1) - sendEventsToRemainder = false; + bool sendEventsToRemainder = false; + if (numChildren == 2) // only one child prim no re-link needed + sendEventsToRemainder = true; foreach (SceneObjectPart p in newSet) { if (p != group.RootPart) { group.DelinkFromGroup(p, sendEventsToRemainder); - if (numChildren > 2) - { - } - else - { + if (sendEventsToRemainder) // finish single child prim now + { p.ParentGroup.HasGroupChanged = true; p.ParentGroup.ScheduleGroupForFullUpdate(); } @@ -2008,8 +2005,8 @@ namespace OpenSim.Region.Framework.Scenes newChild.ClearUpdateSchedule(); LinkObjects(newRoot, newSet); - if (!affectedGroups.Contains(newRoot.ParentGroup)) - affectedGroups.Add(newRoot.ParentGroup); +// if (!affectedGroups.Contains(newRoot.ParentGroup)) +// affectedGroups.Add(newRoot.ParentGroup); } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index b939b58fd6..ca6f457fdf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -3177,9 +3177,6 @@ namespace OpenSim.Region.Framework.Scenes m_scene.AddNewSceneObject(objectGroup, true); - if (sendEvents) - linkPart.TriggerScriptChangedEvent(Changed.LINK); - linkPart.Rezzed = RootPart.Rezzed; // When we delete a group, we currently have to force persist to the database if the object id has changed @@ -3194,6 +3191,9 @@ namespace OpenSim.Region.Framework.Scenes objectGroup.HasGroupChangedDueToDelink = true; + if (sendEvents) + linkPart.TriggerScriptChangedEvent(Changed.LINK); + return objectGroup; }