remove all attachments

master
Christopher 2020-07-10 18:56:38 +02:00
parent 1cd543936c
commit 84bbccae70
1 changed files with 8 additions and 2 deletions

View File

@ -94,15 +94,21 @@ namespace OpenSim.Modules.Appearance2Avatar
if(noteCardContend != null)
{
sp.ClearAttachments();
//Remove all attachments
List<SceneObjectGroup> _allAttachments = sp.GetAttachments();
foreach (SceneObjectGroup _attachment in _allAttachments)
sp.RemoveAttachment(_attachment);
//Load Appearance
m_log.Info(noteCardContend);
m_log.Info("[" + Name + "] Info: Deserialize notecard.");
OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(noteCardContend);
sp.Appearance.Unpack(appearanceOsd);
m_log.Info("[" + Name + "] Info: Send update to all clients");
List<SceneObjectGroup> _allNewAttachments = sp.GetAttachments();
foreach (SceneObjectGroup _attachment in _allAttachments)
sp.SendAttachmentUpdate(_attachment, PrimUpdateFlags.FullUpdate);
sp.SendInitialAvatarDataToAgent(sp);
sp.SendAvatarDataToAllAgents();