aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/World')
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index a43a5f5..b3bfe07 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -89,7 +89,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
89 p_returnUuid = UUID.Zero; 89 p_returnUuid = UUID.Zero;
90 } 90 }
91 91
92 while(p_returnUuid == UUID.Zero) 92 while (p_returnUuid == UUID.Zero)
93 { 93 {
94 Thread.Sleep(250); 94 Thread.Sleep(250);
95 } 95 }
@@ -102,31 +102,37 @@ namespace OpenSim.Region.OptionalModules.World.NPC
102 public void Autopilot(UUID agentID, Scene scene, Vector3 pos) 102 public void Autopilot(UUID agentID, Scene scene, Vector3 pos)
103 { 103 {
104 lock (m_avatars) 104 lock (m_avatars)
105 {
105 if (m_avatars.ContainsKey(agentID)) 106 if (m_avatars.ContainsKey(agentID))
106 { 107 {
107 ScenePresence sp; 108 ScenePresence sp;
108 scene.TryGetAvatar(agentID, out sp); 109 scene.TryGetAvatar(agentID, out sp);
109 sp.DoAutoPilot(0, pos, m_avatars[agentID]); 110 sp.DoAutoPilot(0, pos, m_avatars[agentID]);
110 } 111 }
112 }
111 } 113 }
112 114
113 public void Say(UUID agentID, Scene scene, string text) 115 public void Say(UUID agentID, Scene scene, string text)
114 { 116 {
115 lock (m_avatars) 117 lock (m_avatars)
118 {
116 if (m_avatars.ContainsKey(agentID)) 119 if (m_avatars.ContainsKey(agentID))
117 { 120 {
118 m_avatars[agentID].Say(text); 121 m_avatars[agentID].Say(text);
119 } 122 }
123 }
120 } 124 }
121 125
122 public void DeleteNPC(UUID agentID, Scene scene) 126 public void DeleteNPC(UUID agentID, Scene scene)
123 { 127 {
124 lock(m_avatars) 128 lock (m_avatars)
129 {
125 if (m_avatars.ContainsKey(agentID)) 130 if (m_avatars.ContainsKey(agentID))
126 { 131 {
127 scene.RemoveClient(agentID); 132 scene.RemoveClient(agentID);
128 m_avatars.Remove(agentID); 133 m_avatars.Remove(agentID);
129 } 134 }
135 }
130 } 136 }
131 137
132 138
@@ -146,7 +152,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
146 { 152 {
147 p_inUse = false; 153 p_inUse = false;
148 154
149
150 NPCAvatar npcAvatar = new NPCAvatar(p_firstname, p_lastname, p_position, p_scene); 155 NPCAvatar npcAvatar = new NPCAvatar(p_firstname, p_lastname, p_position, p_scene);
151 npcAvatar.CircuitCode = (uint) Util.RandomClass.Next(0, int.MaxValue); 156 npcAvatar.CircuitCode = (uint) Util.RandomClass.Next(0, int.MaxValue);
152 157