summaryrefslogtreecommitdiff
path: root/src/commands.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands.cpp')
-rw-r--r--src/commands.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index 15070abdf..c31885483 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -114,9 +114,15 @@ bool InspIRCd::HostMatchesEveryone(const std::string &mask, userrec* user)
for (user_hash::iterator u = clientlist->begin(); u != clientlist->end(); u++)
{
- if (match(u->second->MakeHost(),mask.c_str()),true)
+ if ((match(u->second->MakeHost(),mask.c_str(),true)) || (match(u->second->MakeHostIP(),mask.c_str(),true)))
+ {
matches++;
+ }
}
+
+ if (!matches)
+ return false;
+
float percent = ((float)matches / (float)clientlist->size()) * 100;
if (percent > (float)atof(itrigger))
{
@@ -142,7 +148,10 @@ bool InspIRCd::IPMatchesEveryone(const std::string &ip, userrec* user)
if (match(u->second->GetIPString(),ip.c_str(),true))
matches++;
}
-
+
+ if (!matches)
+ return false;
+
float percent = ((float)matches / (float)clientlist->size()) * 100;
if (percent > (float)atof(itrigger))
{
@@ -168,7 +177,10 @@ bool InspIRCd::NickMatchesEveryone(const std::string &nick, userrec* user)
if (match(u->second->nick,nick.c_str()))
matches++;
}
-
+
+ if (!matches)
+ return false;
+
float percent = ((float)matches / (float)clientlist->size()) * 100;
if (percent > (float)atof(itrigger))
{