aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World/NPC
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/NPC')
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index ac39a53..a6d4a93 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -34,6 +34,7 @@ using OpenSim.Region.Framework.Scenes;
34using OpenSim.Region.CoreModules.Avatar.NPC; 34using OpenSim.Region.CoreModules.Avatar.NPC;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using Timer=System.Timers.Timer; 36using Timer=System.Timers.Timer;
37using OpenSim.Services.Interfaces;
37 38
38namespace OpenSim.Region.OptionalModules.World.NPC 39namespace OpenSim.Region.OptionalModules.World.NPC
39{ 40{
@@ -63,11 +64,16 @@ namespace OpenSim.Region.OptionalModules.World.NPC
63 if (m_appearanceCache.ContainsKey(target)) 64 if (m_appearanceCache.ContainsKey(target))
64 return m_appearanceCache[target]; 65 return m_appearanceCache[target];
65 66
66 AvatarAppearance x = scene.CommsManager.AvatarService.GetUserAppearance(target); 67 AvatarData adata = scene.AvatarService.GetAvatar(target);
68 if (adata != null)
69 {
70 AvatarAppearance x = adata.ToAvatarAppearance();
67 71
68 m_appearanceCache.Add(target, x); 72 m_appearanceCache.Add(target, x);
69 73
70 return x; 74 return x;
75 }
76 return new AvatarAppearance();
71 } 77 }
72 78
73 public UUID CreateNPC(string firstname, string lastname,Vector3 position, Scene scene, UUID cloneAppearanceFrom) 79 public UUID CreateNPC(string firstname, string lastname,Vector3 position, Scene scene, UUID cloneAppearanceFrom)