diff options
author | UbitUmarov | 2012-03-09 03:00:31 +0000 |
---|---|---|
committer | UbitUmarov | 2012-03-09 03:00:31 +0000 |
commit | fc4dc7708dc07dc41791de64d7a6b2586d3170b5 (patch) | |
tree | 2b807fd97cdef06e671b52f3e735b849b05f9cfc /OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |
parent | more changes on undo/redo group scaling seems to work better (diff) | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC_OLD-fc4dc7708dc07dc41791de64d7a6b2586d3170b5.zip opensim-SC_OLD-fc4dc7708dc07dc41791de64d7a6b2586d3170b5.tar.gz opensim-SC_OLD-fc4dc7708dc07dc41791de64d7a6b2586d3170b5.tar.bz2 opensim-SC_OLD-fc4dc7708dc07dc41791de64d7a6b2586d3170b5.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 78e9b29..68f21c8 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -88,25 +88,26 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
88 | 88 | ||
89 | public bool SetNPCAppearance(UUID agentId, AvatarAppearance appearance, Scene scene) | 89 | public bool SetNPCAppearance(UUID agentId, AvatarAppearance appearance, Scene scene) |
90 | { | 90 | { |
91 | ScenePresence sp = scene.GetScenePresence(agentId); | 91 | ScenePresence npc = scene.GetScenePresence(agentId); |
92 | if (sp == null || sp.IsChildAgent) | 92 | if (npc == null || npc.IsChildAgent) |
93 | return false; | 93 | return false; |
94 | 94 | ||
95 | lock (m_avatars) | 95 | lock (m_avatars) |
96 | if (!m_avatars.ContainsKey(agentId)) | 96 | if (!m_avatars.ContainsKey(agentId)) |
97 | return false; | 97 | return false; |
98 | 98 | ||
99 | // Delete existing sp attachments | 99 | // Delete existing npc attachments |
100 | scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, false); | 100 | scene.AttachmentsModule.DeleteAttachmentsFromScene(npc, false); |
101 | |||
102 | AvatarAppearance app = new AvatarAppearance(appearance, true); | ||
103 | sp.Appearance = app; | ||
104 | 101 | ||
105 | // Set new sp appearance. Also sends to clients. | 102 | // XXX: We can't just use IAvatarFactoryModule.SetAppearance() yet since it doesn't transfer attachments |
106 | scene.RequestModuleInterface<IAvatarFactoryModule>().SetAppearance(sp, app); | 103 | AvatarAppearance npcAppearance = new AvatarAppearance(appearance, true); |
104 | npc.Appearance = npcAppearance; | ||
107 | 105 | ||
108 | // Rez needed sp attachments | 106 | // Rez needed npc attachments |
109 | scene.AttachmentsModule.RezAttachments(sp); | 107 | scene.AttachmentsModule.RezAttachments(npc); |
108 | |||
109 | IAvatarFactoryModule module = scene.RequestModuleInterface<IAvatarFactoryModule>(); | ||
110 | module.SendAppearance(npc.UUID); | ||
110 | 111 | ||
111 | return true; | 112 | return true; |
112 | } | 113 | } |