summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-12-19 20:35:09 -0500
committerAdam <Adam@anope.org>2013-12-19 20:35:09 -0500
commitab6cd3b26caf127d1052e58e9f906d8ed5c3d986 (patch)
tree501563e7cd9b3d2c838727ce8df759ef3b08f527 /src
parent275f2fd374a75896b356297c1d9de8b13a894d1c (diff)
Fix a few commands not being able to find non conf opers
Diffstat (limited to 'src')
-rw-r--r--src/messages.cpp4
-rw-r--r--src/opertype.cpp18
2 files changed, 18 insertions, 4 deletions
diff --git a/src/messages.cpp b/src/messages.cpp
index b757dde8f..639b07a58 100644
--- a/src/messages.cpp
+++ b/src/messages.cpp
@@ -405,9 +405,9 @@ void Stats::Run(MessageSource &source, const std::vector<Anope::string> &params)
IRCD->SendNumeric(219, source.GetSource(), "%c :End of /STATS report.", params[0][0]);
else
{
- for (unsigned i = 0; i < Config->Opers.size(); ++i)
+ for (unsigned i = 0; i < Oper::opers.size(); ++i)
{
- Oper *o = Config->Opers[i];
+ Oper *o = Oper::opers[i];
const NickAlias *na = NickAlias::Find(o->name);
if (na)
diff --git a/src/opertype.cpp b/src/opertype.cpp
index 0db17464d..153b735ab 100644
--- a/src/opertype.cpp
+++ b/src/opertype.cpp
@@ -12,11 +12,25 @@
#include "opertype.h"
#include "config.h"
+std::vector<Oper *> Oper::opers;
+
+Oper::Oper(const Anope::string &n, OperType *o) : name(n), ot(o), require_oper(false), config(false)
+{
+ opers.push_back(this);
+}
+
+Oper::~Oper()
+{
+ std::vector<Oper *>::iterator it = std::find(opers.begin(), opers.end(), this);
+ if (it != opers.end())
+ opers.erase(it);
+}
+
Oper *Oper::Find(const Anope::string &name)
{
- for (unsigned i = 0; i < Config->Opers.size(); ++i)
+ for (unsigned i = 0; i < opers.size(); ++i)
{
- Oper *o = Config->Opers[i];
+ Oper *o = opers[i];
if (o->name.equals_ci(name))
return o;