refactor: move SP.SaveChangedAttachments() fully into AttachmentsModule

This commit is contained in:
Justin Clark-Casey (justincc)
2011-08-30 23:32:30 +01:00
parent 91f59f246f
commit ddc733cd3d
5 changed files with 38 additions and 26 deletions

View File

@@ -133,6 +133,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
}
}
}
public void SaveChangedAttachments(IScenePresence sp)
{
// Need to copy this list because DetachToInventoryPrep mods it
List<SceneObjectGroup> attachments = new List<SceneObjectGroup>(sp.Attachments.ToArray());
foreach (SceneObjectGroup grp in attachments)
{
if (grp.HasGroupChanged) // Resizer scripts?
{
grp.IsAttachment = false;
grp.AbsolutePosition = grp.RootPart.AttachedPos;
// grp.DetachToInventoryPrep();
UpdateKnownItem(sp.ControllingClient, grp, grp.GetFromItemID(), grp.OwnerID);
grp.IsAttachment = true;
}
}
}
/// <summary>
/// Called by client