From 7bb005b0d1a5ae63ca94a3a3f8ad98e0388ea76b Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 16 Nov 2010 21:01:56 +0000 Subject: Change the way attachments are persisted. Editing a worn attachment will now save properly, as will the results of a resizer script working. Attachment positions are no longer saved on each move, but instead are saved once on logout. Attachment script states are saved as part of the attachment now when detaching. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 34d1c39..bfc1bd6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3746,5 +3746,25 @@ 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.DetachToInventoryPrep(); + attachmentsModule.UpdateKnownItem(ControllingClient, + grp, grp.GetFromItemID(), grp.OwnerID); + } + } + } + } } } -- cgit v1.1