diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index e89368a4b6..9c1154b585 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -178,12 +178,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments UUID itemID = UUID.Zero; if (sp != null) { - foreach (SceneObjectGroup grp in sp.GetAttachments(AttachmentPt)) + foreach(SceneObjectGroup grp in sp.Attachments) { - itemID = grp.GetFromItemID(); - if (itemID != UUID.Zero) - DetachSingleAttachmentToInv(itemID, remoteClient); + if (grp.GetAttachmentPoint() == (byte)AttachmentPt) + { + itemID = grp.GetFromItemID(); + break; + } } + if (itemID != UUID.Zero) + DetachSingleAttachmentToInv(itemID, remoteClient); } if (group.GetFromItemID() == UUID.Zero)