public bool DeleteNPC(UUID agentID, Scene scene) { lock (m_avatars) { NPCAvatar av; if (m_avatars.TryGetValue(agentID, out av)) { /* m_log.DebugFormat("[NPC MODULE]: Found {0} {1} to remove", agentID, av.Name); */ scene.IncomingCloseAgent(agentID, false); // scene.RemoveClient(agentID, false); m_avatars.Remove(agentID); /* m_log.DebugFormat("[NPC MODULE]: Removed NPC {0} {1}", agentID, av.Name); */ return true; } } /* m_log.DebugFormat("[NPC MODULE]: Could not find {0} to remove", agentID); */ return false; }
public void DeleteNPC(UUID agentID, Scene scene) { lock (m_avatars) { if (m_avatars.ContainsKey(agentID)) { scene.IncomingCloseAgent(agentID); m_avatars.Remove(agentID); } } }