diff options
author | Mic Bowman | 2011-06-15 11:26:45 -0700 |
---|---|---|
committer | Mic Bowman | 2011-06-15 11:26:45 -0700 |
commit | 29da57e3802948bbffce43c071e6c97742cabf84 (patch) | |
tree | 905ea6ea346ef92c60c99a05c5ed36989d48e71c | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-29da57e3802948bbffce43c071e6c97742cabf84.zip opensim-SC_OLD-29da57e3802948bbffce43c071e6c97742cabf84.tar.gz opensim-SC_OLD-29da57e3802948bbffce43c071e6c97742cabf84.tar.bz2 opensim-SC_OLD-29da57e3802948bbffce43c071e6c97742cabf84.tar.xz |
Add the PhysActor to the correct SOP when duplicating a physical
prim. Thanks, MisterBlue
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 79660a3..f745169 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1449,18 +1449,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
1449 | 1449 | ||
1450 | foreach (SceneObjectPart part in partList) | 1450 | foreach (SceneObjectPart part in partList) |
1451 | { | 1451 | { |
1452 | SceneObjectPart newPart; | ||
1452 | if (part.UUID != m_rootPart.UUID) | 1453 | if (part.UUID != m_rootPart.UUID) |
1453 | { | 1454 | { |
1454 | SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed); | 1455 | newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed); |
1455 | newPart.LinkNum = part.LinkNum; | 1456 | newPart.LinkNum = part.LinkNum; |
1456 | } | 1457 | } |
1458 | else | ||
1459 | { | ||
1460 | newPart = dupe.m_rootPart; | ||
1461 | } | ||
1457 | 1462 | ||
1458 | // Need to duplicate the physics actor as well | 1463 | // Need to duplicate the physics actor as well |
1459 | if (part.PhysActor != null && userExposed) | 1464 | if (part.PhysActor != null && userExposed) |
1460 | { | 1465 | { |
1461 | PrimitiveBaseShape pbs = part.Shape; | 1466 | PrimitiveBaseShape pbs = part.Shape; |
1462 | 1467 | ||
1463 | part.PhysActor | 1468 | newPart.PhysActor |
1464 | = m_scene.PhysicsScene.AddPrimShape( | 1469 | = m_scene.PhysicsScene.AddPrimShape( |
1465 | string.Format("{0}/{1}", part.Name, part.UUID), | 1470 | string.Format("{0}/{1}", part.Name, part.UUID), |
1466 | pbs, | 1471 | pbs, |
@@ -1469,8 +1474,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1469 | part.RotationOffset, | 1474 | part.RotationOffset, |
1470 | part.PhysActor.IsPhysical); | 1475 | part.PhysActor.IsPhysical); |
1471 | 1476 | ||
1472 | part.PhysActor.LocalID = part.LocalId; | 1477 | newPart.PhysActor.LocalID = part.LocalId; |
1473 | part.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true); | 1478 | newPart.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true); |
1474 | } | 1479 | } |
1475 | } | 1480 | } |
1476 | 1481 | ||