From 2ebb421331c4e6c4f57e0cc1bab79cea70937172 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Tue, 14 Feb 2012 17:20:34 -0800 Subject: Refactor appearance saving for NPC to use AvatarFactoryModule interface. --- OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/OptionalModules/World/NPC') diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index dc6eefc..5359354 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -96,15 +96,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC if (!m_avatars.ContainsKey(agentId)) return false; + // Delete existing sp attachments scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, false); - AvatarAppearance npcAppearance = new AvatarAppearance(appearance, true); - sp.Appearance = npcAppearance; + // Set new sp appearance. Also sends to clients. + scene.RequestModuleInterface().SetAppearance(sp, new AvatarAppearance(appearance, true)); + + // Rez needed sp attachments scene.AttachmentsModule.RezAttachments(sp); - - IAvatarFactoryModule module = scene.RequestModuleInterface(); - module.SendAppearance(sp.UUID); - + return true; } -- cgit v1.1