diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 99e0153..2b0e4ab 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -152,31 +152,40 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
152 | } | 152 | } |
153 | } | 153 | } |
154 | 154 | ||
155 | public void SaveChangedAttachments(IScenePresence sp, bool saveAllScripted) | 155 | public void DeRezAttachments(IScenePresence sp, bool saveChanged, bool saveAllScripted) |
156 | { | 156 | { |
157 | // m_log.DebugFormat("[ATTACHMENTS MODULE]: Saving changed attachments for {0}", sp.Name); | ||
158 | |||
159 | if (!Enabled) | 157 | if (!Enabled) |
160 | return; | 158 | return; |
161 | 159 | ||
162 | foreach (SceneObjectGroup grp in sp.GetAttachments()) | 160 | // m_log.DebugFormat("[ATTACHMENTS MODULE]: Saving changed attachments for {0}", sp.Name); |
161 | |||
162 | lock (sp.AttachmentsSyncLock) | ||
163 | { | 163 | { |
164 | grp.IsAttachment = false; | 164 | foreach (SceneObjectGroup grp in sp.GetAttachments()) |
165 | grp.AbsolutePosition = grp.RootPart.AttachedPos; | 165 | { |
166 | UpdateKnownItem(sp, grp, saveAllScripted); | 166 | grp.Scene.DeleteSceneObject(grp, false); |
167 | grp.IsAttachment = true; | 167 | |
168 | if (saveChanged || saveAllScripted) | ||
169 | { | ||
170 | grp.IsAttachment = false; | ||
171 | grp.AbsolutePosition = grp.RootPart.AttachedPos; | ||
172 | UpdateKnownItem(sp, grp, saveAllScripted); | ||
173 | } | ||
174 | } | ||
175 | |||
176 | sp.ClearAttachments(); | ||
168 | } | 177 | } |
169 | } | 178 | } |
170 | 179 | ||
171 | public void DeleteAttachmentsFromScene(IScenePresence sp, bool silent) | 180 | public void DeleteAttachmentsFromScene(IScenePresence sp, bool silent) |
172 | { | 181 | { |
173 | // m_log.DebugFormat( | ||
174 | // "[ATTACHMENTS MODULE]: Deleting attachments from scene {0} for {1}, silent = {2}", | ||
175 | // m_scene.RegionInfo.RegionName, sp.Name, silent); | ||
176 | |||
177 | if (!Enabled) | 182 | if (!Enabled) |
178 | return; | 183 | return; |
179 | 184 | ||
185 | // m_log.DebugFormat( | ||
186 | // "[ATTACHMENTS MODULE]: Deleting attachments from scene {0} for {1}, silent = {2}", | ||
187 | // m_scene.RegionInfo.RegionName, sp.Name, silent); | ||
188 | |||
180 | foreach (SceneObjectGroup sop in sp.GetAttachments()) | 189 | foreach (SceneObjectGroup sop in sp.GetAttachments()) |
181 | { | 190 | { |
182 | sop.Scene.DeleteSceneObject(sop, silent); | 191 | sop.Scene.DeleteSceneObject(sop, silent); |