mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
refactor: move SP.SaveChangedAttachments() fully into AttachmentsModule
This commit is contained in:
@@ -3162,8 +3162,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
m_eventManager.TriggerOnRemovePresence(agentID);
|
||||
|
||||
if (avatar != null && (!avatar.IsChildAgent) && avatar.PresenceType != PresenceType.Npc)
|
||||
avatar.SaveChangedAttachments();
|
||||
if (AttachmentsModule != null && avatar != null && (!avatar.IsChildAgent) && avatar.PresenceType != PresenceType.Npc)
|
||||
AttachmentsModule.SaveChangedAttachments(avatar);
|
||||
|
||||
ForEachClient(
|
||||
delegate(IClientAPI client)
|
||||
|
||||
@@ -3831,28 +3831,5 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_reprioritization_called = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveChangedAttachments()
|
||||
{
|
||||
// Need to copy this list because DetachToInventoryPrep mods it
|
||||
List<SceneObjectGroup> attachments = new List<SceneObjectGroup>(Attachments.ToArray());
|
||||
|
||||
IAttachmentsModule attachmentsModule = m_scene.AttachmentsModule;
|
||||
if (attachmentsModule != null)
|
||||
{
|
||||
foreach (SceneObjectGroup grp in attachments)
|
||||
{
|
||||
if (grp.HasGroupChanged) // Resizer scripts?
|
||||
{
|
||||
grp.IsAttachment = false;
|
||||
grp.AbsolutePosition = grp.RootPart.AttachedPos;
|
||||
// grp.DetachToInventoryPrep();
|
||||
attachmentsModule.UpdateKnownItem(ControllingClient,
|
||||
grp, grp.GetFromItemID(), grp.OwnerID);
|
||||
grp.IsAttachment = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user