mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Fix issue where loading a new appearance onto an NPC would not remove the previous attachments from the scene.
Addresses http://opensimulator.org/mantis/view.php?id=5636
This commit is contained in:
@@ -143,6 +143,16 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
if (!m_avatars.ContainsKey(agentId))
|
||||
return false;
|
||||
|
||||
// FIXME: An extremely bad bit of code that reaches directly into the attachments list and manipulates it
|
||||
List<SceneObjectGroup> attachments = sp.Attachments;
|
||||
lock (attachments)
|
||||
{
|
||||
foreach (SceneObjectGroup att in attachments)
|
||||
scene.DeleteSceneObject(att, false);
|
||||
|
||||
attachments.Clear();
|
||||
}
|
||||
|
||||
AvatarAppearance npcAppearance = new AvatarAppearance(appearance, true);
|
||||
sp.Appearance = npcAppearance;
|
||||
sp.RezAttachments();
|
||||
|
||||
Reference in New Issue
Block a user