From 3ee91cb3c6d55c67d63c77db0c3cc4febf56eaff Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 9 Sep 2008 03:48:09 +0000 Subject: Preserve link numbers when items are taken into inventory and re-rezzed. --- OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index c049e86..1b2ea8e 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -357,13 +357,16 @@ namespace OpenSim.Region.Environment.Scenes xmlData = xmlData.Replace("", ""); StringReader sr = new StringReader(xmlData); XmlTextReader reader = new XmlTextReader(sr); + try { reader.Read(); reader.ReadStartElement("SceneObjectGroup"); reader.ReadStartElement("RootPart"); m_rootPart = SceneObjectPart.FromXml(reader); + int linkNum = m_rootPart.LinkNum; AddPart(m_rootPart); + m_rootPart.LinkNum = linkNum; reader.ReadEndElement(); @@ -377,7 +380,9 @@ namespace OpenSim.Region.Environment.Scenes reader.Read(); SceneObjectPart part = SceneObjectPart.FromXml(reader); part.LocalId = m_scene.PrimIDAllocate(); + linkNum = part.LinkNum; AddPart(part); + part.LinkNum = linkNum; part.RegionHandle = m_regionHandle; part.TrimPermissions(); @@ -1459,7 +1464,7 @@ namespace OpenSim.Region.Environment.Scenes m_parts.Clear(); foreach (SceneObjectPart part in partsList) { - part.ResetIDs(m_parts.Count); + part.ResetIDs(part.LinkNum); // Don't change link nums m_parts.Add(part.UUID, part); } } -- cgit v1.1