refactor: change AttachmentsModule.AttachObject to use sp.GetAttachments rather than filter sp.Attachments list directly

prebuild-update
Justin Clark-Casey (justincc) 2010-08-31 22:22:45 +01:00
parent 9c1c378aa1
commit 01276ef433
1 changed files with 5 additions and 9 deletions

View File

@ -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)