Change AttachmentsModule.DetachSingleAttachmentToInv() to accept a SOG directly instead of an item ID to then shuffle through attachments, saving CPU busywork.

Almost all callers already had the sog to hand.
Still checking that it's really an attachment, but now by inspecting SOG.AttachedAvatar
This commit is contained in:
Justin Clark-Casey (justincc)
2012-06-28 23:31:23 +01:00
parent 571fd966cb
commit bfa6896678
5 changed files with 58 additions and 52 deletions

View File

@@ -109,11 +109,11 @@ namespace OpenSim.Region.Framework.Interfaces
void DetachSingleAttachmentToGround(IScenePresence sp, uint objectLocalID);
/// <summary>
/// Detach the given item so that it remains in the user's inventory.
/// Detach the given attachment so that it remains in the user's inventory.
/// </summary>
/// <param name="sp">/param>
/// <param name="itemID"></param>
void DetachSingleAttachmentToInv(IScenePresence sp, UUID itemID);
/// <param name="grp">The attachment to detach.</param>
void DetachSingleAttachmentToInv(IScenePresence sp, SceneObjectGroup grp);
/// <summary>
/// Update the position of an attachment.

View File

@@ -72,6 +72,10 @@ namespace OpenSim.Region.Framework.Interfaces
/// <returns></returns>
List<SceneObjectGroup> GetAttachments(uint attachmentPoint);
/// <summary>
/// Does this avatar have any attachments?
/// </summary>
/// <returns></returns>
bool HasAttachments();
// Don't use these methods directly. Instead, use the AttachmentsModule