From 29da57e3802948bbffce43c071e6c97742cabf84 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Wed, 15 Jun 2011 11:26:45 -0700 Subject: Add the PhysActor to the correct SOP when duplicating a physical prim. Thanks, MisterBlue --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') 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 foreach (SceneObjectPart part in partList) { + SceneObjectPart newPart; if (part.UUID != m_rootPart.UUID) { - SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed); + newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed); newPart.LinkNum = part.LinkNum; } + else + { + newPart = dupe.m_rootPart; + } // Need to duplicate the physics actor as well if (part.PhysActor != null && userExposed) { PrimitiveBaseShape pbs = part.Shape; - part.PhysActor + newPart.PhysActor = m_scene.PhysicsScene.AddPrimShape( string.Format("{0}/{1}", part.Name, part.UUID), pbs, @@ -1469,8 +1474,8 @@ namespace OpenSim.Region.Framework.Scenes part.RotationOffset, part.PhysActor.IsPhysical); - part.PhysActor.LocalID = part.LocalId; - part.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true); + newPart.PhysActor.LocalID = part.LocalId; + newPart.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true); } } -- cgit v1.1