From e7a515bab0e46c228f8f543397f97b7ba2f0df3c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 30 Aug 2011 22:06:24 +0100 Subject: Fix bug where attachments were remaining on the avatar after being dropped. If the inventory service is configured not to allow deletion then these will not disappear from inventory --- .../CoreModules/Avatar/Attachments/AttachmentsModule.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 2d5eb18..b7a7f77 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -451,6 +451,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments public void DetachSingleAttachmentToGround(UUID sceneObjectID, IClientAPI remoteClient) { +// m_log.DebugFormat( +// "[ATTACHMENTS MODULE]: DetachSingleAttachmentToGround() for {0}, object {1}", +// remoteClient.Name, sceneObjectID); + SceneObjectGroup so = m_scene.GetSceneObjectGroup(sceneObjectID); if (so == null) @@ -461,6 +465,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments UUID inventoryID = so.GetFromItemID(); +// m_log.DebugFormat( +// "[ATTACHMENTS MODULE]: In DetachSingleAttachmentToGround(), object is {0} {1}, associated item is {2}", +// so.Name, so.LocalId, inventoryID); + ScenePresence presence; if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) { @@ -468,7 +476,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments so.PrimCount, remoteClient.AgentId, presence.AbsolutePosition)) return; - bool changed = presence.Appearance.DetachAttachment(sceneObjectID); + bool changed = presence.Appearance.DetachAttachment(inventoryID); if (changed && m_scene.AvatarFactory != null) m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); @@ -485,7 +493,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments } /// - /// Detach the given scene objet to the ground. + /// Detach the given scene object to the ground. /// /// /// The caller has to take care of all the other work in updating avatar appearance, inventory, etc. -- cgit v1.1