From 01276ef43304c3bd9a090e809b7d4f44ecfffcf5 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 31 Aug 2010 22:22:45 +0100 Subject: [PATCH] refactor: change AttachmentsModule.AttachObject to use sp.GetAttachments rather than filter sp.Attachments list directly --- .../Avatar/Attachments/AttachmentsModule.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index d56145a2a5..de654609f9 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -173,16 +173,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments UUID itemID = UUID.Zero; if (sp != null) { - foreach(SceneObjectGroup grp in sp.Attachments) + foreach(SceneObjectGroup grp in sp.GetAttachments(AttachmentPt)) { - if (grp.GetAttachmentPoint() == (byte)AttachmentPt) - { - itemID = grp.GetFromItemID(); - break; - } - } - if (itemID != UUID.Zero) - DetachSingleAttachmentToInv(itemID, remoteClient); + itemID = grp.GetFromItemID(); + if (itemID != UUID.Zero) + DetachSingleAttachmentToInv(itemID, remoteClient); + } } if (group.GetFromItemID() == UUID.Zero)