aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs34
1 files changed, 21 insertions, 13 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index c779a5d..6cd0bae 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -734,16 +734,18 @@ namespace OpenSim.Region.Environment.Scenes
734 m_rootPart.IsAttachment = true; 734 m_rootPart.IsAttachment = true;
735 735
736 m_rootPart.SetParentLocalId(avatar.LocalId); 736 m_rootPart.SetParentLocalId(avatar.LocalId);
737 lock (m_parts) 737 SetAttachmentPoint(Convert.ToByte(attachmentpoint));
738 {
739 foreach (SceneObjectPart part in m_parts.Values)
740 {
741 part.SetAttachmentPoint(attachmentpoint);
742 }
743 }
744 738
745 avatar.AddAttachment(this); 739 avatar.AddAttachment(this);
746 m_rootPart.ScheduleFullUpdate(); 740 // Killing it here will cause the client to deselect it
741 // It then reappears on the avatar, deselected
742 // through the full update below
743 //
744 foreach (SceneObjectPart part in m_parts.Values)
745 m_scene.SendKiPrimitive(part.LocalId);
746
747 IsSelected = false; // fudge....
748 ScheduleGroupForFullUpdate();
747 } 749 }
748 } 750 }
749 public byte GetAttachmentPoint() 751 public byte GetAttachmentPoint()
@@ -757,10 +759,7 @@ namespace OpenSim.Region.Environment.Scenes
757 759
758 public void ClearPartAttachmentData() 760 public void ClearPartAttachmentData()
759 { 761 {
760 foreach (SceneObjectPart part in m_parts.Values) 762 SetAttachmentPoint((Byte)0);
761 {
762 part.SetAttachmentPoint((Byte)0);
763 }
764 } 763 }
765 764
766 public void DetachToGround() 765 public void DetachToGround()
@@ -775,7 +774,7 @@ namespace OpenSim.Region.Environment.Scenes
775 AbsolutePosition = detachedpos; 774 AbsolutePosition = detachedpos;
776 m_rootPart.AttachedAvatar = UUID.Zero; 775 m_rootPart.AttachedAvatar = UUID.Zero;
777 m_rootPart.SetParentLocalId(0); 776 m_rootPart.SetParentLocalId(0);
778 m_rootPart.SetAttachmentPoint((byte)0); 777 SetAttachmentPoint((byte)0);
779 m_rootPart.IsAttachment = false; 778 m_rootPart.IsAttachment = false;
780 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim); 779 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim);
781 HasGroupChanged = true; 780 HasGroupChanged = true;
@@ -2755,5 +2754,14 @@ namespace OpenSim.Region.Environment.Scenes
2755 { 2754 {
2756 return String.Format("{0} {1} ({2})", Name, UUID, AbsolutePosition); 2755 return String.Format("{0} {1} ({2})", Name, UUID, AbsolutePosition);
2757 } 2756 }
2757
2758 public void SetAttachmentPoint(byte point)
2759 {
2760 lock(m_parts)
2761 {
2762 foreach (SceneObjectPart part in m_parts.Values)
2763 part.SetAttachmentPoint(point);
2764 }
2765 }
2758 } 2766 }
2759} 2767}