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 --- .../Avatar/Attachments/AttachmentsModule.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (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 f6aea89..201ce7f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -133,6 +133,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments } } } + + public void SaveChangedAttachments(IScenePresence sp) + { + // Need to copy this list because DetachToInventoryPrep mods it + List attachments = new List(sp.Attachments.ToArray()); + + foreach (SceneObjectGroup grp in attachments) + { + if (grp.HasGroupChanged) // Resizer scripts? + { + grp.IsAttachment = false; + grp.AbsolutePosition = grp.RootPart.AttachedPos; +// grp.DetachToInventoryPrep(); + UpdateKnownItem(sp.ControllingClient, grp, grp.GetFromItemID(), grp.OwnerID); + grp.IsAttachment = true; + } + } + } /// /// Called by client -- cgit v1.1