Preserving the link numbers is a serializer's highest duty.

Prevent region crossings from screwing up complex attachments by preserving
link numbers.
avinationmerge
Melanie Thielker 2010-06-12 08:29:20 +02:00
parent e337c9130f
commit 03a48f87e4
1 changed files with 9 additions and 0 deletions

View File

@ -221,7 +221,16 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
sr = new StringReader(parts[i].OuterXml);
reader = new XmlTextReader(sr);
SceneObjectPart part = SceneObjectPart.FromXml(reader);
int originalLinkNum = part.LinkNum;
sceneObject.AddPart(part);
// SceneObjectGroup.AddPart() tries to be smart and automatically set the LinkNum.
// We override that here
if (originalLinkNum != 0)
part.LinkNum = originalLinkNum;
part.StoreUndoState();
reader.Close();
sr.Close();