diff options
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.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 19 |
1 files changed, 8 insertions, 11 deletions
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 | |||
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
151 | public void SaveChangedAttachments(IScenePresence sp) | 151 | public void SaveChangedAttachments(IScenePresence sp, bool saveAllScripted) |
152 | { | 152 | { |
153 | // m_log.DebugFormat("[ATTACHMENTS MODULE]: Saving changed attachments for {0}", sp.Name); | 153 | // m_log.DebugFormat("[ATTACHMENTS MODULE]: Saving changed attachments for {0}", sp.Name); |
154 | 154 | ||
@@ -157,13 +157,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
157 | 157 | ||
158 | foreach (SceneObjectGroup grp in sp.GetAttachments()) | 158 | foreach (SceneObjectGroup grp in sp.GetAttachments()) |
159 | { | 159 | { |
160 | // if (grp.HasGroupChanged) // Resizer scripts? | 160 | grp.IsAttachment = false; |
161 | // { | 161 | grp.AbsolutePosition = grp.RootPart.AttachedPos; |
162 | grp.IsAttachment = false; | 162 | UpdateKnownItem(sp, grp, saveAllScripted); |
163 | grp.AbsolutePosition = grp.RootPart.AttachedPos; | 163 | grp.IsAttachment = true; |
164 | UpdateKnownItem(sp, grp); | ||
165 | grp.IsAttachment = true; | ||
166 | // } | ||
167 | } | 164 | } |
168 | } | 165 | } |
169 | 166 | ||
@@ -460,7 +457,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
460 | /// </remarks> | 457 | /// </remarks> |
461 | /// <param name="sp"></param> | 458 | /// <param name="sp"></param> |
462 | /// <param name="grp"></param> | 459 | /// <param name="grp"></param> |
463 | private void UpdateKnownItem(IScenePresence sp, SceneObjectGroup grp) | 460 | private void UpdateKnownItem(IScenePresence sp, SceneObjectGroup grp, bool saveAllScripted) |
464 | { | 461 | { |
465 | // Saving attachments for NPCs messes them up for the real owner! | 462 | // Saving attachments for NPCs messes them up for the real owner! |
466 | INPCModule module = m_scene.RequestModuleInterface<INPCModule>(); | 463 | INPCModule module = m_scene.RequestModuleInterface<INPCModule>(); |
@@ -470,7 +467,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
470 | return; | 467 | return; |
471 | } | 468 | } |
472 | 469 | ||
473 | if (grp.HasGroupChanged || grp.ContainsScripts()) | 470 | if (grp.HasGroupChanged || (saveAllScripted && grp.ContainsScripts())) |
474 | { | 471 | { |
475 | m_log.DebugFormat( | 472 | m_log.DebugFormat( |
476 | "[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}", | 473 | "[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}", |
@@ -696,7 +693,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
696 | group.IsAttachment = false; | 693 | group.IsAttachment = false; |
697 | group.AbsolutePosition = group.RootPart.AttachedPos; | 694 | group.AbsolutePosition = group.RootPart.AttachedPos; |
698 | 695 | ||
699 | UpdateKnownItem(sp, group); | 696 | UpdateKnownItem(sp, group, true); |
700 | m_scene.DeleteSceneObject(group, false); | 697 | m_scene.DeleteSceneObject(group, false); |
701 | 698 | ||
702 | return; | 699 | return; |