diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 4dbc5e6600..0316d2947a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -101,7 +101,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
///
public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent)
{
- m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject");
+// m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject");
try
{
@@ -466,7 +466,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
{
m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero);
group.DetachToInventoryPrep();
- m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString());
+// m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString());
// If an item contains scripts, it's always changed.
// This ensures script state is saved on detach
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index 6cc64c6113..4cb3df24ab 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -96,9 +96,10 @@ namespace OpenSim.Region.Framework.Interfaces
///
/// Detach an object from the avatar.
///
- ///
+ ///
/// This method is called in response to a client's detach request, so we only update the information in
/// inventory
+ ///
///
///
void DetachObject(uint objectLocalID, IClientAPI remoteClient);
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 11fda6df1e..3b7ae9d246 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -143,6 +143,16 @@ namespace OpenSim.Region.OptionalModules.World.NPC
if (!m_avatars.ContainsKey(agentId))
return false;
+ // FIXME: An extremely bad bit of code that reaches directly into the attachments list and manipulates it
+ List attachments = sp.Attachments;
+ lock (attachments)
+ {
+ foreach (SceneObjectGroup att in attachments)
+ scene.DeleteSceneObject(att, false);
+
+ attachments.Clear();
+ }
+
AvatarAppearance npcAppearance = new AvatarAppearance(appearance, true);
sp.Appearance = npcAppearance;
sp.RezAttachments();