summaryrefslogtreecommitdiff
path: root/modules/pseudoclients/botserv.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-12-19 08:48:04 -0500
committerAdam <Adam@anope.org>2012-12-19 08:48:23 -0500
commit784683a68dc3882f9507b9d304f4adf10fb403ae (patch)
tree7fa9d69db84f9a382bf5688adc5a007186e39a14 /modules/pseudoclients/botserv.cpp
parent3b2094301d6cfb6ef4e17746c93a31f82d21a703 (diff)
Having these references to bots bugged out older compilers, so simplify this by just moving pointers to the core
Diffstat (limited to 'modules/pseudoclients/botserv.cpp')
-rw-r--r--modules/pseudoclients/botserv.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/modules/pseudoclients/botserv.cpp b/modules/pseudoclients/botserv.cpp
index addb39e0c..6f9046957 100644
--- a/modules/pseudoclients/botserv.cpp
+++ b/modules/pseudoclients/botserv.cpp
@@ -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