Some more work on SceneObjectGroup
parent
050921d7b6
commit
8af12cd9a8
|
@ -203,20 +203,24 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public new SceneObjectGroup Copy()
|
public new SceneObjectGroup Copy()
|
||||||
{
|
{
|
||||||
SceneObjectGroup dupe = (SceneObjectGroup)this.MemberwiseClone();
|
SceneObjectGroup dupe = (SceneObjectGroup)this.MemberwiseClone();
|
||||||
|
dupe.m_parts.Clear();
|
||||||
dupe.Pos = new LLVector3(Pos.X, Pos.Y, Pos.Z);
|
dupe.Pos = new LLVector3(Pos.X, Pos.Y, Pos.Z);
|
||||||
dupe.m_scene = m_scene;
|
dupe.m_scene = m_scene;
|
||||||
dupe.m_regionHandle = this.m_regionHandle;
|
dupe.m_regionHandle = this.m_regionHandle;
|
||||||
|
|
||||||
dupe.CopyRootPart(this.m_rootPart);
|
dupe.CopyRootPart(this.m_rootPart);
|
||||||
m_scene.EventManager.OnBackup += dupe.ProcessBackup;
|
|
||||||
|
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
List<SceneObjectPart> partList = new List<SceneObjectPart>(this.m_parts.Values);
|
||||||
|
foreach (SceneObjectPart part in partList)
|
||||||
{
|
{
|
||||||
if (part.UUID != this.m_rootPart.UUID)
|
if (part.UUID != this.m_rootPart.UUID)
|
||||||
{
|
{
|
||||||
dupe.CopyPart(part);
|
dupe.CopyPart(part);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dupe.UpdateParentIDs();
|
||||||
|
|
||||||
|
m_scene.EventManager.OnBackup += dupe.ProcessBackup;
|
||||||
return dupe;
|
return dupe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,6 +231,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void CopyRootPart(SceneObjectPart part)
|
public void CopyRootPart(SceneObjectPart part)
|
||||||
{
|
{
|
||||||
SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate());
|
SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate());
|
||||||
|
newPart.SetParent(this);
|
||||||
this.m_parts.Add(newPart.UUID, newPart);
|
this.m_parts.Add(newPart.UUID, newPart);
|
||||||
this.SetPartAsRoot(newPart);
|
this.SetPartAsRoot(newPart);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue