From 3cd1a24a51b9560a6dd6590b4a384f6b6942370d Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 9 Jan 2010 17:48:40 +0000 Subject: Remove mode counter, not reliable and only used for umode +i git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12246 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/usermanager.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/usermanager.cpp') diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 1e3e9fa72..afabf4047 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -392,10 +392,12 @@ void UserManager::ServerPrivmsgAll(const char* text, ...) /* return how many users have a given mode e.g. 'a' */ int UserManager::ModeCount(const char mode) { - ModeHandler* mh = ServerInstance->Modes->FindMode(mode, MODETYPE_USER); - - if (mh) - return mh->GetCount(); - else - return 0; + int c = 0; + for(user_hash::iterator i = clientlist->begin(); i != clientlist->end(); ++i) + { + User* u = i->second; + if (u->modes[mode-65]) + c++; + } + return c; } -- cgit v1.2.3