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 +++++++-
OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | 2 ++
2 files changed, 9 insertions(+), 1 deletion(-)
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);
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index a675928..1d9aeb9 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -133,5 +133,7 @@ namespace OpenSim.Region.Framework.Interfaces
///
///
void UpdateAttachmentPosition(IClientAPI client, SceneObjectGroup sog, Vector3 pos);
+
+ void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID);
}
}
--
cgit v1.1