From 7a9c57a81ec979564b089429bb93655912f823a2 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 16 Nov 2010 01:35:45 +0100 Subject: When detaching a scripted item, always consider it modified. Script states will have changed and for real usability, we need to save it. It bloats assets, but that can't be avoided. --- .../Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (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 6122cc2..929db21 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -527,10 +527,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments /// /// /// - protected void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID) + public void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID) { if (grp != null) { + // If an item contains scripts, it's always changed. + // This ensures script state is saved on detach + foreach (SceneObjectPart p in grp.Parts) + if (p.Inventory.ContainsScripts()) + grp.HasGroupChanged = true; + if (!grp.HasGroupChanged) { m_log.WarnFormat("[ATTACHMENTS MODULE]: Save request for {0} which is unchanged", grp.UUID); -- cgit v1.1