diff options
author | Justin Clark-Casey (justincc) | 2011-08-17 01:35:33 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-17 01:35:33 +0100 |
commit | acfdca34fd9bf6d66d144ae5c0a325dd5e864517 (patch) | |
tree | fa04bcde5a48a26ef3867d82019f8f1eb35cb6b8 /OpenSim/Region/OptionalModules/World/NPC | |
parent | extend test to check that there is one attachment and that it has the right name (diff) | |
download | opensim-SC_OLD-acfdca34fd9bf6d66d144ae5c0a325dd5e864517.zip opensim-SC_OLD-acfdca34fd9bf6d66d144ae5c0a325dd5e864517.tar.gz opensim-SC_OLD-acfdca34fd9bf6d66d144ae5c0a325dd5e864517.tar.bz2 opensim-SC_OLD-acfdca34fd9bf6d66d144ae5c0a325dd5e864517.tar.xz |
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
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/NPC')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 11fda6d..3b7ae9d 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -143,6 +143,16 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
143 | if (!m_avatars.ContainsKey(agentId)) | 143 | if (!m_avatars.ContainsKey(agentId)) |
144 | return false; | 144 | return false; |
145 | 145 | ||
146 | // FIXME: An extremely bad bit of code that reaches directly into the attachments list and manipulates it | ||
147 | List<SceneObjectGroup> attachments = sp.Attachments; | ||
148 | lock (attachments) | ||
149 | { | ||
150 | foreach (SceneObjectGroup att in attachments) | ||
151 | scene.DeleteSceneObject(att, false); | ||
152 | |||
153 | attachments.Clear(); | ||
154 | } | ||
155 | |||
146 | AvatarAppearance npcAppearance = new AvatarAppearance(appearance, true); | 156 | AvatarAppearance npcAppearance = new AvatarAppearance(appearance, true); |
147 | sp.Appearance = npcAppearance; | 157 | sp.Appearance = npcAppearance; |
148 | sp.RezAttachments(); | 158 | sp.RezAttachments(); |