mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
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:
@@ -2990,15 +2990,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
private void DetachWrapper(object o)
|
||||
{
|
||||
SceneObjectPart host = (SceneObjectPart)o;
|
||||
|
||||
SceneObjectGroup grp = host.ParentGroup;
|
||||
UUID itemID = grp.FromItemID;
|
||||
ScenePresence presence = World.GetScenePresence(host.OwnerID);
|
||||
|
||||
IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
|
||||
if (attachmentsModule != null)
|
||||
attachmentsModule.DetachSingleAttachmentToInv(presence, itemID);
|
||||
if (World.AttachmentsModule != null)
|
||||
{
|
||||
SceneObjectPart host = (SceneObjectPart)o;
|
||||
ScenePresence presence = World.GetScenePresence(host.OwnerID);
|
||||
World.AttachmentsModule.DetachSingleAttachmentToInv(presence, host.ParentGroup);
|
||||
}
|
||||
}
|
||||
|
||||
public void llAttachToAvatar(int attachmentPoint)
|
||||
|
||||
Reference in New Issue
Block a user