aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs20
1 files changed, 16 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 9839126..7bdcb5c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1336,6 +1336,8 @@ namespace OpenSim.Region.Environment.Scenes
1336 1336
1337 dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); 1337 dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
1338 1338
1339 dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
1340
1339 if (userExposed) 1341 if (userExposed)
1340 dupe.m_rootPart.TrimPermissions(); 1342 dupe.m_rootPart.TrimPermissions();
1341 1343
@@ -1368,16 +1370,25 @@ namespace OpenSim.Region.Environment.Scenes
1368 } 1370 }
1369 1371
1370 List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values); 1372 List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values);
1373 partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
1374 {
1375 return p1.LinkNum.CompareTo(p2.LinkNum);
1376 }
1377 );
1378
1371 foreach (SceneObjectPart part in partList) 1379 foreach (SceneObjectPart part in partList)
1372 { 1380 {
1373 if (part.UUID != m_rootPart.UUID) 1381 if (part.UUID != m_rootPart.UUID)
1374 { 1382 {
1375 dupe.CopyPart(part, OwnerID, GroupID, userExposed); 1383 SceneObjectPart newPart =
1384 dupe.CopyPart(part, OwnerID, GroupID, userExposed);
1385
1386 newPart.LinkNum = part.LinkNum;
1376 1387
1377 if (userExposed) 1388 if (userExposed)
1378 { 1389 {
1379 SetPartOwner(part, cAgentID, cGroupID); 1390 SetPartOwner(newPart, cAgentID, cGroupID);
1380 part.ScheduleFullUpdate(); 1391 newPart.ScheduleFullUpdate();
1381 } 1392 }
1382 } 1393 }
1383 } 1394 }
@@ -1507,7 +1518,7 @@ namespace OpenSim.Region.Environment.Scenes
1507 /// <param name="part"></param> 1518 /// <param name="part"></param>
1508 /// <param name="cAgentID"></param> 1519 /// <param name="cAgentID"></param>
1509 /// <param name="cGroupID"></param> 1520 /// <param name="cGroupID"></param>
1510 public void CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed) 1521 public SceneObjectPart CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
1511 { 1522 {
1512 SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed); 1523 SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed);
1513 newPart.SetParent(this); 1524 newPart.SetParent(this);
@@ -1519,6 +1530,7 @@ namespace OpenSim.Region.Environment.Scenes
1519 1530
1520 SetPartAsNonRoot(newPart); 1531 SetPartAsNonRoot(newPart);
1521 1532
1533 return newPart;
1522 } 1534 }
1523 1535
1524 /// <summary> 1536 /// <summary>