1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 11:03:12 +02:00

Having these references to bots bugged out older compilers, so simplify this by just moving pointers to the core

This commit is contained in:
Adam
2012-12-19 08:48:04 -05:00
parent 3b2094301d
commit 784683a68d
22 changed files with 77 additions and 82 deletions
+10 -6
View File
@@ -20,20 +20,24 @@ class BotServCore : public Module
{
this->SetAuthor("Anope");
BotInfo *bi = BotInfo::Find(Config->BotServ);
if (!bi)
BotServ = BotInfo::Find(Config->BotServ);
if (!BotServ)
throw ModuleException("No bot named " + Config->BotServ);
Implementation i[] = { I_OnPrivmsg, I_OnJoinChannel, I_OnLeaveChannel,
Implementation i[] = { I_OnBotDelete, I_OnPrivmsg, I_OnJoinChannel, I_OnLeaveChannel,
I_OnPreHelp, I_OnPostHelp, I_OnChannelModeSet };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
Service::AddAlias("BotInfo", "BotServ", bi->nick);
}
~BotServCore()
{
Service::DelAlias("BotInfo", "BotServ");
BotServ = NULL;
}
void OnBotDelete(BotInfo *bi) anope_override
{
if (bi == BotServ)
BotServ = NULL;
}
void OnPrivmsg(User *u, Channel *c, Anope::string &msg) anope_override