aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs47
1 files changed, 36 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index d4658ec..445c2c8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1499,10 +1499,13 @@ namespace OpenSim.Region.Framework.Scenes
1499 /// <param name="childPrims"></param> 1499 /// <param name="childPrims"></param>
1500 protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children) 1500 protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children)
1501 { 1501 {
1502 SceneObjectGroup parentGroup = root.ParentGroup;
1503 if (parentGroup == null) return;
1502 Monitor.Enter(m_updateLock); 1504 Monitor.Enter(m_updateLock);
1505
1503 try 1506 try
1504 { 1507 {
1505 SceneObjectGroup parentGroup = root.ParentGroup; 1508 parentGroup.areUpdatesSuspended = true;
1506 1509
1507 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); 1510 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>();
1508 if (parentGroup != null) 1511 if (parentGroup != null)
@@ -1541,12 +1544,12 @@ namespace OpenSim.Region.Framework.Scenes
1541 // occur on link to invoke this elsewhere (such as object selection) 1544 // occur on link to invoke this elsewhere (such as object selection)
1542 parentGroup.RootPart.AddFlag(PrimFlags.CreateSelected); 1545 parentGroup.RootPart.AddFlag(PrimFlags.CreateSelected);
1543 parentGroup.TriggerScriptChangedEvent(Changed.LINK); 1546 parentGroup.TriggerScriptChangedEvent(Changed.LINK);
1544 parentGroup.HasGroupChanged = true;
1545 parentGroup.ScheduleGroupForFullUpdate();
1546
1547 } 1547 }
1548 finally 1548 finally
1549 { 1549 {
1550 parentGroup.areUpdatesSuspended = false;
1551 parentGroup.HasGroupChanged = true;
1552 parentGroup.ScheduleGroupForFullUpdate();
1550 Monitor.Exit(m_updateLock); 1553 Monitor.Exit(m_updateLock);
1551 } 1554 }
1552 } 1555 }
@@ -1583,11 +1586,22 @@ namespace OpenSim.Region.Framework.Scenes
1583 } 1586 }
1584 } 1587 }
1585 1588
1586 foreach (SceneObjectPart child in childParts) 1589 if (childParts.Count > 0)
1587 { 1590 {
1588 // Unlink all child parts from their groups 1591 try
1589 // 1592 {
1590 child.ParentGroup.DelinkFromGroup(child, true); 1593 childParts[0].ParentGroup.areUpdatesSuspended = true;
1594 foreach (SceneObjectPart child in childParts)
1595 {
1596 // Unlink all child parts from their groups
1597 //
1598 child.ParentGroup.DelinkFromGroup(child, true);
1599 }
1600 }
1601 finally
1602 {
1603 childParts[0].ParentGroup.areUpdatesSuspended = false;
1604 }
1591 } 1605 }
1592 1606
1593 foreach (SceneObjectPart root in rootParts) 1607 foreach (SceneObjectPart root in rootParts)
@@ -1611,10 +1625,21 @@ namespace OpenSim.Region.Framework.Scenes
1611 if (numChildren > 1) 1625 if (numChildren > 1)
1612 sendEventsToRemainder = false; 1626 sendEventsToRemainder = false;
1613 1627
1614 foreach (SceneObjectPart p in newSet) 1628 if (newSet.Count > 0)
1615 { 1629 {
1616 if (p != group.RootPart) 1630 try
1617 group.DelinkFromGroup(p, sendEventsToRemainder); 1631 {
1632 newSet[0].ParentGroup.areUpdatesSuspended = true;
1633 foreach (SceneObjectPart p in newSet)
1634 {
1635 if (p != group.RootPart)
1636 group.DelinkFromGroup(p, sendEventsToRemainder);
1637 }
1638 }
1639 finally
1640 {
1641 newSet[0].ParentGroup.areUpdatesSuspended = false;
1642 }
1618 } 1643 }
1619 1644
1620 // If there is more than one prim remaining, we 1645 // If there is more than one prim remaining, we