From ddc733cd3d940a4357eb0d235562050eb6f206bf Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 30 Aug 2011 23:32:30 +0100 Subject: refactor: move SP.SaveChangedAttachments() fully into AttachmentsModule --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++-- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 25 +----------------------- 2 files changed, 3 insertions(+), 26 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e7fe8df..e0e3884 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3162,8 +3162,8 @@ namespace OpenSim.Region.Framework.Scenes m_eventManager.TriggerOnRemovePresence(agentID); - if (avatar != null && (!avatar.IsChildAgent) && avatar.PresenceType != PresenceType.Npc) - avatar.SaveChangedAttachments(); + if (AttachmentsModule != null && avatar != null && (!avatar.IsChildAgent) && avatar.PresenceType != PresenceType.Npc) + AttachmentsModule.SaveChangedAttachments(avatar); ForEachClient( delegate(IClientAPI client) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 040e801..91e11eb 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3831,28 +3831,5 @@ namespace OpenSim.Region.Framework.Scenes m_reprioritization_called = false; } } - - public void SaveChangedAttachments() - { - // Need to copy this list because DetachToInventoryPrep mods it - List attachments = new List(Attachments.ToArray()); - - IAttachmentsModule attachmentsModule = m_scene.AttachmentsModule; - if (attachmentsModule != null) - { - foreach (SceneObjectGroup grp in attachments) - { - if (grp.HasGroupChanged) // Resizer scripts? - { - grp.IsAttachment = false; - grp.AbsolutePosition = grp.RootPart.AttachedPos; -// grp.DetachToInventoryPrep(); - attachmentsModule.UpdateKnownItem(ControllingClient, - grp, grp.GetFromItemID(), grp.OwnerID); - grp.IsAttachment = true; - } - } - } - } } -} +} \ No newline at end of file -- cgit v1.1