From 658524311307561a133451753daceff493d3cdad Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 8 Nov 2010 02:35:47 +0000 Subject: Detach attachments displaced by other attachments --- .../CoreModules/Avatar/Attachments/AttachmentsModule.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index e89368a..9c1154b 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) -- cgit v1.1