From 0bda2cf5bcc8204eb3487e287a33d7289544947e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 10 Nov 2008 21:06:26 +0000 Subject: * refactor: clean up SOG xml2 reloading to reuse more code --- OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 15 ++++----------- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 2 -- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 9afe8cd..f5c5838 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -454,11 +454,7 @@ namespace OpenSim.Region.Environment.Scenes reader.Read(); reader.ReadStartElement("SceneObjectGroup"); - m_rootPart = SceneObjectPart.FromXml(reader); - m_rootPart.SetParent(this); - m_parts.Add(m_rootPart.UUID, m_rootPart); - m_rootPart.ParentID = 0; - m_rootPart.LinkNum = 0; + SetRootPart(SceneObjectPart.FromXml(reader)); reader.Read(); bool more = true; @@ -470,12 +466,9 @@ namespace OpenSim.Region.Environment.Scenes case XmlNodeType.Element: if (reader.Name == "SceneObjectPart") { - SceneObjectPart Part = SceneObjectPart.FromXml(reader); - if (m_rootPart.LinkNum == 0) - m_rootPart.LinkNum++; - AddPart(Part); - Part.LinkNum = m_parts.Count; - Part.StoreUndoState(); + SceneObjectPart part = SceneObjectPart.FromXml(reader); + AddPart(part); + part.StoreUndoState(); } else { diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 4d54634..05b23aa 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -2414,8 +2414,6 @@ if (m_shape != null) { } } - - if (m_parentGroup.GetSceneMaxUndo() > 0) { UndoState nUndo = new UndoState(this); -- cgit v1.1