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

Prevent region crossings from screwing up complex attachments by preserving
link numbers.
soprefactor
Melanie Thielker 2010-06-12 08:29:20 +02:00 committed by Melanie
parent 4c58ac2c90
commit 3c036934a3
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();