From ddfb16de1a61a9b80ece0ba6e5fd34326abf5f18 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 14 Mar 2011 20:16:38 -0400 Subject: Fixed compile --- src/botserv.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/botserv.cpp') diff --git a/src/botserv.cpp b/src/botserv.cpp index a7076bcf5..4d0255cd5 100644 --- a/src/botserv.cpp +++ b/src/botserv.cpp @@ -34,9 +34,9 @@ void get_botserv_stats(long *nrec, long *memuse) { long count = 0, mem = 0; - for (patricia_tree::iterator it(BotListByNick); it.next();) + for (Anope::insensitive_map::const_iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it) { - BotInfo *bi = *it; + BotInfo *bi = it->second; ++count; mem += sizeof(*bi); @@ -361,11 +361,19 @@ void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf) BotInfo *findbot(const Anope::string &nick) { - BotInfo *bi; + BotInfo *bi = NULL; if (isdigit(nick[0]) && ircd->ts6) - bi = BotListByUID.find(nick); + { + Anope::map::iterator it = BotListByUID.find(nick); + if (it != BotListByUID.end()) + bi = it->second; + } else - bi = BotListByNick.find(nick); + { + Anope::insensitive_map::iterator it = BotListByNick.find(nick); + if (it != BotListByNick.end()) + bi = it->second; + } FOREACH_MOD(I_OnFindBot, OnFindBot(nick)); -- cgit