diff options
author | Justin Clark-Casey (justincc) | 2012-06-28 23:31:23 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-06-28 23:31:23 +0100 |
commit | bfa6896678872a4e796ec4de22e83b6cead3ba17 (patch) | |
tree | 38c266a595d458f4783105ce8157c0dfc3c556ca /OpenSim/Region/ScriptEngine/Shared | |
parent | Rather than iterating through all SOGs in the scene looking for the one that ... (diff) | |
download | opensim-SC_OLD-bfa6896678872a4e796ec4de22e83b6cead3ba17.zip opensim-SC_OLD-bfa6896678872a4e796ec4de22e83b6cead3ba17.tar.gz opensim-SC_OLD-bfa6896678872a4e796ec4de22e83b6cead3ba17.tar.bz2 opensim-SC_OLD-bfa6896678872a4e796ec4de22e83b6cead3ba17.tar.xz |
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
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a8679e2..12eb098 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2990,15 +2990,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2990 | 2990 | ||
2991 | private void DetachWrapper(object o) | 2991 | private void DetachWrapper(object o) |
2992 | { | 2992 | { |
2993 | SceneObjectPart host = (SceneObjectPart)o; | 2993 | if (World.AttachmentsModule != null) |
2994 | 2994 | { | |
2995 | SceneObjectGroup grp = host.ParentGroup; | 2995 | SceneObjectPart host = (SceneObjectPart)o; |
2996 | UUID itemID = grp.FromItemID; | 2996 | ScenePresence presence = World.GetScenePresence(host.OwnerID); |
2997 | ScenePresence presence = World.GetScenePresence(host.OwnerID); | 2997 | World.AttachmentsModule.DetachSingleAttachmentToInv(presence, host.ParentGroup); |
2998 | 2998 | } | |
2999 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; | ||
3000 | if (attachmentsModule != null) | ||
3001 | attachmentsModule.DetachSingleAttachmentToInv(presence, itemID); | ||
3002 | } | 2999 | } |
3003 | 3000 | ||
3004 | public void llAttachToAvatar(int attachmentPoint) | 3001 | public void llAttachToAvatar(int attachmentPoint) |