From 01981fdf58dfe70c6df5ac514ca67fbd1ad2bc18 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 2 Aug 2014 18:57:43 +0100 Subject: dont fire a thread on npc creation keeping the main one just waiting --- OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 9ec4740..226608a 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -170,9 +170,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC } */ - ManualResetEvent ev = new ManualResetEvent(false); +// ManualResetEvent ev = new ManualResetEvent(false); - Util.FireAndForget(delegate(object x) { +// Util.FireAndForget(delegate(object x) { lock (m_avatars) { scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd); @@ -181,15 +181,16 @@ namespace OpenSim.Region.OptionalModules.World.NPC ScenePresence sp; if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) { + sp.CompleteMovement(npcAvatar, false); m_avatars.Add(npcAvatar.AgentId, npcAvatar); // m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name); } } - ev.Set(); - }); +// ev.Set(); +// }); - ev.WaitOne(); +// ev.WaitOne(); // m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId); -- cgit v1.1