Preserve link numbers when items are taken into inventory and re-rezzed.

0.6.0-stable
Melanie Thielker 2008-09-09 03:48:09 +00:00
parent fae34bb10c
commit 3ee91cb3c6
1 changed files with 6 additions and 1 deletions

View File

@ -357,13 +357,16 @@ namespace OpenSim.Region.Environment.Scenes
xmlData = xmlData.Replace("</Guid></Guid>", "</Guid></UUID>"); xmlData = xmlData.Replace("</Guid></Guid>", "</Guid></UUID>");
StringReader sr = new StringReader(xmlData); StringReader sr = new StringReader(xmlData);
XmlTextReader reader = new XmlTextReader(sr); XmlTextReader reader = new XmlTextReader(sr);
try try
{ {
reader.Read(); reader.Read();
reader.ReadStartElement("SceneObjectGroup"); reader.ReadStartElement("SceneObjectGroup");
reader.ReadStartElement("RootPart"); reader.ReadStartElement("RootPart");
m_rootPart = SceneObjectPart.FromXml(reader); m_rootPart = SceneObjectPart.FromXml(reader);
int linkNum = m_rootPart.LinkNum;
AddPart(m_rootPart); AddPart(m_rootPart);
m_rootPart.LinkNum = linkNum;
reader.ReadEndElement(); reader.ReadEndElement();
@ -377,7 +380,9 @@ namespace OpenSim.Region.Environment.Scenes
reader.Read(); reader.Read();
SceneObjectPart part = SceneObjectPart.FromXml(reader); SceneObjectPart part = SceneObjectPart.FromXml(reader);
part.LocalId = m_scene.PrimIDAllocate(); part.LocalId = m_scene.PrimIDAllocate();
linkNum = part.LinkNum;
AddPart(part); AddPart(part);
part.LinkNum = linkNum;
part.RegionHandle = m_regionHandle; part.RegionHandle = m_regionHandle;
part.TrimPermissions(); part.TrimPermissions();
@ -1459,7 +1464,7 @@ namespace OpenSim.Region.Environment.Scenes
m_parts.Clear(); m_parts.Clear();
foreach (SceneObjectPart part in partsList) 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); m_parts.Add(part.UUID, part);
} }
} }