From fcc1fa2c32af3df8962e470150b641dda036a8ab Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 1 Feb 2012 09:36:14 +0000
Subject: Straighten out some attachment mess. Don't save attachment states for
HG visitors at all. On Leaving a sim, save only the changed ones. Don't save
all scripted stuff when leaving a sim.
---
.../Avatar/Attachments/AttachmentsModule.cs | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
(limited to 'OpenSim/Region/CoreModules')
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 2142d02..65ba730 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -148,7 +148,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
}
}
- public void SaveChangedAttachments(IScenePresence sp)
+ public void SaveChangedAttachments(IScenePresence sp, bool saveAllScripted)
{
// m_log.DebugFormat("[ATTACHMENTS MODULE]: Saving changed attachments for {0}", sp.Name);
@@ -157,13 +157,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
foreach (SceneObjectGroup grp in sp.GetAttachments())
{
-// if (grp.HasGroupChanged) // Resizer scripts?
-// {
- grp.IsAttachment = false;
- grp.AbsolutePosition = grp.RootPart.AttachedPos;
- UpdateKnownItem(sp, grp);
- grp.IsAttachment = true;
-// }
+ grp.IsAttachment = false;
+ grp.AbsolutePosition = grp.RootPart.AttachedPos;
+ UpdateKnownItem(sp, grp, saveAllScripted);
+ grp.IsAttachment = true;
}
}
@@ -460,7 +457,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
///
///
///
- private void UpdateKnownItem(IScenePresence sp, SceneObjectGroup grp)
+ private void UpdateKnownItem(IScenePresence sp, SceneObjectGroup grp, bool saveAllScripted)
{
// Saving attachments for NPCs messes them up for the real owner!
INPCModule module = m_scene.RequestModuleInterface();
@@ -470,7 +467,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
return;
}
- if (grp.HasGroupChanged || grp.ContainsScripts())
+ if (grp.HasGroupChanged || (saveAllScripted && grp.ContainsScripts()))
{
m_log.DebugFormat(
"[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}",
@@ -696,7 +693,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
group.IsAttachment = false;
group.AbsolutePosition = group.RootPart.AttachedPos;
- UpdateKnownItem(sp, group);
+ UpdateKnownItem(sp, group, true);
m_scene.DeleteSceneObject(group, false);
return;
--
cgit v1.1