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.cs41
1 files changed, 9 insertions, 32 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index d31b45e..ad24160 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1619,20 +1619,21 @@ namespace OpenSim.Region.Framework.Scenes
1619 /// <param name="client"></param> 1619 /// <param name="client"></param>
1620 /// <param name="parentPrim"></param> 1620 /// <param name="parentPrim"></param>
1621 /// <param name="childPrims"></param> 1621 /// <param name="childPrims"></param>
1622 protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds) 1622 protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children)
1623 { 1623 {
1624 Monitor.Enter(m_updateLock); 1624 Monitor.Enter(m_updateLock);
1625 try 1625 try
1626 { 1626 {
1627 SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); 1627 SceneObjectGroup parentGroup = root.ParentGroup;
1628 1628
1629 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); 1629 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>();
1630 if (parentGroup != null) 1630 if (parentGroup != null)
1631 { 1631 {
1632 // We do this in reverse to get the link order of the prims correct 1632 // We do this in reverse to get the link order of the prims correct
1633 for (int i = childPrimIds.Count - 1; i >= 0; i--) 1633 for (int i = children.Count - 1; i >= 0; i--)
1634 { 1634 {
1635 SceneObjectGroup child = GetGroupByPrim(childPrimIds[i]); 1635 SceneObjectGroup child = children[i].ParentGroup;
1636
1636 if (child != null) 1637 if (child != null)
1637 { 1638 {
1638 // Make sure no child prim is set for sale 1639 // Make sure no child prim is set for sale
@@ -1665,17 +1666,6 @@ namespace OpenSim.Region.Framework.Scenes
1665 parentGroup.HasGroupChanged = true; 1666 parentGroup.HasGroupChanged = true;
1666 parentGroup.ScheduleGroupForFullUpdate(); 1667 parentGroup.ScheduleGroupForFullUpdate();
1667 1668
1668// if (client != null)
1669// {
1670// parentGroup.GetProperties(client);
1671// }
1672// else
1673// {
1674// foreach (ScenePresence p in GetScenePresences())
1675// {
1676// parentGroup.GetProperties(p.ControllingClient);
1677// }
1678// }
1679 } 1669 }
1680 finally 1670 finally
1681 { 1671 {
@@ -1687,12 +1677,7 @@ namespace OpenSim.Region.Framework.Scenes
1687 /// Delink a linkset 1677 /// Delink a linkset
1688 /// </summary> 1678 /// </summary>
1689 /// <param name="prims"></param> 1679 /// <param name="prims"></param>
1690 protected internal void DelinkObjects(List<uint> primIds) 1680 protected internal void DelinkObjects(List<SceneObjectPart> prims)
1691 {
1692 DelinkObjects(primIds, true);
1693 }
1694
1695 protected internal void DelinkObjects(List<uint> primIds, bool sendEvents)
1696 { 1681 {
1697 Monitor.Enter(m_updateLock); 1682 Monitor.Enter(m_updateLock);
1698 try 1683 try
@@ -1702,9 +1687,8 @@ namespace OpenSim.Region.Framework.Scenes
1702 List<SceneObjectGroup> affectedGroups = new List<SceneObjectGroup>(); 1687 List<SceneObjectGroup> affectedGroups = new List<SceneObjectGroup>();
1703 // Look them all up in one go, since that is comparatively expensive 1688 // Look them all up in one go, since that is comparatively expensive
1704 // 1689 //
1705 foreach (uint primID in primIds) 1690 foreach (SceneObjectPart part in prims)
1706 { 1691 {
1707 SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID);
1708 if (part != null) 1692 if (part != null)
1709 { 1693 {
1710 if (part.ParentGroup.Children.Count != 1) // Skip single 1694 if (part.ParentGroup.Children.Count != 1) // Skip single
@@ -1719,17 +1703,13 @@ namespace OpenSim.Region.Framework.Scenes
1719 affectedGroups.Add(group); 1703 affectedGroups.Add(group);
1720 } 1704 }
1721 } 1705 }
1722 else
1723 {
1724 m_log.ErrorFormat("Viewer requested unlink of nonexistent part {0}", primID);
1725 }
1726 } 1706 }
1727 1707
1728 foreach (SceneObjectPart child in childParts) 1708 foreach (SceneObjectPart child in childParts)
1729 { 1709 {
1730 // Unlink all child parts from their groups 1710 // Unlink all child parts from their groups
1731 // 1711 //
1732 child.ParentGroup.DelinkFromGroup(child, sendEvents); 1712 child.ParentGroup.DelinkFromGroup(child, true);
1733 } 1713 }
1734 1714
1735 foreach (SceneObjectPart root in rootParts) 1715 foreach (SceneObjectPart root in rootParts)
@@ -1784,12 +1764,9 @@ namespace OpenSim.Region.Framework.Scenes
1784 List<uint> linkIDs = new List<uint>(); 1764 List<uint> linkIDs = new List<uint>();
1785 1765
1786 foreach (SceneObjectPart newChild in newSet) 1766 foreach (SceneObjectPart newChild in newSet)
1787 {
1788 newChild.UpdateFlag = 0; 1767 newChild.UpdateFlag = 0;
1789 linkIDs.Add(newChild.LocalId);
1790 }
1791 1768
1792 LinkObjects(null, newRoot.LocalId, linkIDs); 1769 LinkObjects(newRoot, newSet);
1793 if (!affectedGroups.Contains(newRoot.ParentGroup)) 1770 if (!affectedGroups.Contains(newRoot.ParentGroup))
1794 affectedGroups.Add(newRoot.ParentGroup); 1771 affectedGroups.Add(newRoot.ParentGroup);
1795 } 1772 }