aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World/NPC
diff options
context:
space:
mode:
authorMelanie2012-08-14 21:43:23 +0100
committerMelanie2012-08-14 21:43:23 +0100
commit9ec35d09f8b4bf29356364ae0f18bdadfc9092c4 (patch)
tree45f4b687ce48c0cb9edef3c94de9cb86d7ce47f4 /OpenSim/Region/OptionalModules/World/NPC
parentMerge branch 'master' into careminster (diff)
parentPrevent race conditions when one thread removes an NPC SP before another thre... (diff)
downloadopensim-SC-9ec35d09f8b4bf29356364ae0f18bdadfc9092c4.zip
opensim-SC-9ec35d09f8b4bf29356364ae0f18bdadfc9092c4.tar.gz
opensim-SC-9ec35d09f8b4bf29356364ae0f18bdadfc9092c4.tar.bz2
opensim-SC-9ec35d09f8b4bf29356364ae0f18bdadfc9092c4.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/NPC')
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs62
1 files changed, 29 insertions, 33 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index b37aba3..cef2cfd 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -177,16 +177,17 @@ namespace OpenSim.Region.OptionalModules.World.NPC
177 if (m_avatars.ContainsKey(agentID)) 177 if (m_avatars.ContainsKey(agentID))
178 { 178 {
179 ScenePresence sp; 179 ScenePresence sp;
180 scene.TryGetScenePresence(agentID, out sp); 180 if (scene.TryGetScenePresence(agentID, out sp))
181 181 {
182 m_log.DebugFormat( 182 m_log.DebugFormat(
183 "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}", 183 "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}",
184 sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget); 184 sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget);
185
186 sp.MoveToTarget(pos, noFly, landAtTarget);
187 sp.SetAlwaysRun = running;
188 185
189 return true; 186 sp.MoveToTarget(pos, noFly, landAtTarget);
187 sp.SetAlwaysRun = running;
188
189 return true;
190 }
190 } 191 }
191 } 192 }
192 193
@@ -200,12 +201,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC
200 if (m_avatars.ContainsKey(agentID)) 201 if (m_avatars.ContainsKey(agentID))
201 { 202 {
202 ScenePresence sp; 203 ScenePresence sp;
203 scene.TryGetScenePresence(agentID, out sp); 204 if (scene.TryGetScenePresence(agentID, out sp))
204 205 {
205 sp.Velocity = Vector3.Zero; 206 sp.Velocity = Vector3.Zero;
206 sp.ResetMoveToTarget(); 207 sp.ResetMoveToTarget();
207 208
208 return true; 209 return true;
210 }
209 } 211 }
210 } 212 }
211 213
@@ -223,9 +225,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
223 { 225 {
224 if (m_avatars.ContainsKey(agentID)) 226 if (m_avatars.ContainsKey(agentID))
225 { 227 {
226 ScenePresence sp;
227 scene.TryGetScenePresence(agentID, out sp);
228
229 m_avatars[agentID].Say(channel, text); 228 m_avatars[agentID].Say(channel, text);
230 229
231 return true; 230 return true;
@@ -241,9 +240,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
241 { 240 {
242 if (m_avatars.ContainsKey(agentID)) 241 if (m_avatars.ContainsKey(agentID))
243 { 242 {
244 ScenePresence sp;
245 scene.TryGetScenePresence(agentID, out sp);
246
247 m_avatars[agentID].Shout(channel, text); 243 m_avatars[agentID].Shout(channel, text);
248 244
249 return true; 245 return true;
@@ -260,11 +256,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC
260 if (m_avatars.ContainsKey(agentID)) 256 if (m_avatars.ContainsKey(agentID))
261 { 257 {
262 ScenePresence sp; 258 ScenePresence sp;
263 scene.TryGetScenePresence(agentID, out sp); 259 if (scene.TryGetScenePresence(agentID, out sp))
264 sp.HandleAgentRequestSit(m_avatars[agentID], agentID, partID, Vector3.Zero); 260 {
265// sp.HandleAgentSit(m_avatars[agentID], agentID); 261 sp.HandleAgentRequestSit(m_avatars[agentID], agentID, partID, Vector3.Zero);
266 262 // sp.HandleAgentSit(m_avatars[agentID], agentID);
267 return true; 263
264 return true;
265 }
268 } 266 }
269 } 267 }
270 268
@@ -277,9 +275,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
277 { 275 {
278 if (m_avatars.ContainsKey(agentID)) 276 if (m_avatars.ContainsKey(agentID))
279 { 277 {
280 ScenePresence sp;
281 scene.TryGetScenePresence(agentID, out sp);
282
283 m_avatars[agentID].Whisper(channel, text); 278 m_avatars[agentID].Whisper(channel, text);
284 279
285 return true; 280 return true;
@@ -296,10 +291,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC
296 if (m_avatars.ContainsKey(agentID)) 291 if (m_avatars.ContainsKey(agentID))
297 { 292 {
298 ScenePresence sp; 293 ScenePresence sp;
299 scene.TryGetScenePresence(agentID, out sp); 294 if (scene.TryGetScenePresence(agentID, out sp))
300 sp.StandUp(); 295 {
296 sp.StandUp();
301 297
302 return true; 298 return true;
299 }
303 } 300 }
304 } 301 }
305 302
@@ -312,6 +309,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
312 { 309 {
313 if (m_avatars.ContainsKey(agentID)) 310 if (m_avatars.ContainsKey(agentID))
314 return m_avatars[agentID].Touch(objectID); 311 return m_avatars[agentID].Touch(objectID);
312
315 return false; 313 return false;
316 } 314 }
317 } 315 }
@@ -322,9 +320,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
322 { 320 {
323 NPCAvatar av; 321 NPCAvatar av;
324 if (m_avatars.TryGetValue(agentID, out av)) 322 if (m_avatars.TryGetValue(agentID, out av))
325 {
326 return av.OwnerID; 323 return av.OwnerID;
327 }
328 } 324 }
329 325
330 return UUID.Zero; 326 return UUID.Zero;