diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 55e7da450c..c583ce750e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2548,6 +2548,11 @@ namespace OpenSim.Region.Framework.Scenes return false; } + + public void updateScenePartGroup(SceneObjectPart part, SceneObjectGroup grp) + { + m_sceneGraph.updateScenePartGroup(part, grp); + } /// /// Move the given scene object into a new region depending on which region its absolute position has moved /// into. diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 973891bc5c..bc91961ed4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -462,6 +462,20 @@ namespace OpenSim.Region.Framework.Scenes return true; } + public void updateScenePartGroup(SceneObjectPart part, SceneObjectGroup grp) + { + // no tests, caller has responsability... + lock (SceneObjectGroupsByFullPartID) + { + SceneObjectGroupsByFullPartID[part.UUID] = grp; + } + + lock (SceneObjectGroupsByLocalPartID) + { + SceneObjectGroupsByLocalPartID[part.LocalId] = grp; + } + } + /// /// Delete an object from the scene /// @@ -1804,7 +1818,7 @@ namespace OpenSim.Region.Framework.Scenes List childGroups = new List(); // We do this in reverse to get the link order of the prims correct - for (int i = 0 ; i < children.Count ; i++) + for (int i = 0; i < children.Count; i++) { SceneObjectGroup child = children[i].ParentGroup; @@ -1815,7 +1829,7 @@ namespace OpenSim.Region.Framework.Scenes // Make sure no child prim is set for sale // So that, on delink, no prims are unwittingly // left for sale and sold off - + if (child != null) { child.RootPart.ObjectSaleType = 0; @@ -1850,12 +1864,13 @@ namespace OpenSim.Region.Framework.Scenes } finally { +/* lock (SceneObjectGroupsByLocalPartID) { foreach (SceneObjectPart part in parentGroup.Parts) SceneObjectGroupsByLocalPartID[part.LocalId] = parentGroup; } - +*/ parentGroup.AdjustChildPrimPermissions(); parentGroup.HasGroupChanged = true; parentGroup.ProcessBackup(m_parentScene.SimulationDataService, true); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 15349e30a7..b939b58fd6 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2560,11 +2560,8 @@ namespace OpenSim.Region.Framework.Scenes /// public SceneObjectPart CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed) { - // give new ID to the new part, letting old keep original - // SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed); SceneObjectPart newPart = part.Copy(part.LocalId, OwnerID, GroupID, m_parts.Count, userExposed); newPart.LocalId = m_scene.AllocateLocalId(); - newPart.SetParent(this); AddPart(newPart); @@ -2977,6 +2974,8 @@ namespace OpenSim.Region.Framework.Scenes m_parts.Add(linkPart.UUID, linkPart); linkPart.SetParent(this); + m_scene.updateScenePartGroup(linkPart, this); + linkPart.CreateSelected = true; // let physics know preserve part volume dtc messy since UpdatePrimFlags doesn't look to parent changes for now @@ -3238,9 +3237,12 @@ namespace OpenSim.Region.Framework.Scenes part.SetParent(this); part.ParentID = m_rootPart.LocalId; m_parts.Add(part.UUID, part); + part.LinkNum = linkNum; + m_scene.updateScenePartGroup(part, this); + // Compute the new position of this SOP relative to the group position part.OffsetPosition = newPos - AbsolutePosition;