summaryrefslogtreecommitdiff
path: root/src/bots.cpp
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-08 20:06:21 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-08 20:06:21 +0000
commit458be36a321615c0f3004a6abde7e14d40f5da32 (patch)
tree711be83fc6f2d49f9d31015db51730cdac57f687 /src/bots.cpp
parent38ad96c57c520dd84c8de21766f5de082a844a99 (diff)
Rewrote all of the old C style flag systems into a new Flag class which everything inherits from. This breaks reading and writing flags to the old databases (and probably many other things aswell) - Don't use it
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2636 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/bots.cpp')
-rw-r--r--src/bots.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/bots.cpp b/src/bots.cpp
index 4cb4556f2..8a4198b74 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -19,23 +19,22 @@ BotInfo::BotInfo(const char *nnick)
this->uid = ts6_uid_retrieve(); // XXX is this safe? has ts6 been setup yet?
nbots++;
this->cmdTable = NULL;
- this->flags = 0;
this->chancount = 0;
if (s_ChanServ && !stricmp(s_ChanServ, nnick))
- this->flags |= BI_CHANSERV;
+ this->SetFlag(BI_CHANSERV);
else if (s_BotServ && !stricmp(s_BotServ, nnick))
- this->flags |= BI_BOTSERV;
+ this->SetFlag(BI_BOTSERV);
else if (s_HostServ && !stricmp(s_HostServ, nnick))
- this->flags |= BI_HOSTSERV;
+ this->SetFlag(BI_HOSTSERV);
else if (s_OperServ && !stricmp(s_OperServ, nnick))
- this->flags |= BI_OPERSERV;
+ this->SetFlag(BI_OPERSERV);
else if (s_MemoServ && !stricmp(s_MemoServ, nnick))
- this->flags |= BI_MEMOSERV;
+ this->SetFlag(BI_MEMOSERV);
else if (s_NickServ && !stricmp(s_NickServ, nnick))
- this->flags |= BI_NICKSERV;
+ this->SetFlag(BI_NICKSERV);
else if (s_GlobalNoticer && !stricmp(s_GlobalNoticer, nnick))
- this->flags |= BI_GLOBAL;
+ this->SetFlag(BI_GLOBAL);
FOREACH_MOD(I_OnBotPreLoad, OnBotPreLoad(this));
@@ -57,23 +56,22 @@ BotInfo::BotInfo(const char *nnick, const char *nuser, const char *nhost, const
this->uid = ts6_uid_retrieve(); // XXX is this safe? has ts6 been setup yet?
nbots++;
this->cmdTable = NULL;
- this->flags = 0;
this->chancount = 0;
if (s_ChanServ && !stricmp(s_ChanServ, nnick))
- this->flags |= BI_CHANSERV;
+ this->SetFlag(BI_CHANSERV);
else if (s_BotServ && !stricmp(s_BotServ, nnick))
- this->flags |= BI_BOTSERV;
+ this->SetFlag(BI_BOTSERV);
else if (s_HostServ && !stricmp(s_HostServ, nnick))
- this->flags |= BI_HOSTSERV;
+ this->SetFlag(BI_HOSTSERV);
else if (s_OperServ && !stricmp(s_OperServ, nnick))
- this->flags |= BI_OPERSERV;
+ this->SetFlag(BI_OPERSERV);
else if (s_MemoServ && !stricmp(s_MemoServ, nnick))
- this->flags |= BI_MEMOSERV;
+ this->SetFlag(BI_MEMOSERV);
else if (s_NickServ && !stricmp(s_NickServ, nnick))
- this->flags |= BI_NICKSERV;
+ this->SetFlag(BI_NICKSERV);
else if (s_GlobalNoticer && !stricmp(s_GlobalNoticer, nnick))
- this->flags |= BI_GLOBAL;
+ this->SetFlag(BI_GLOBAL);
FOREACH_MOD(I_OnBotPreLoad, OnBotPreLoad(this));