1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 17:26:38 +02:00

Fix a few commands not being able to find non conf opers

This commit is contained in:
Adam
2013-12-19 20:35:09 -05:00
parent 275f2fd374
commit ab6cd3b26c
8 changed files with 53 additions and 20 deletions
+16 -2
View File
@@ -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;