diff options
author | Adam <Adam@anope.org> | 2012-12-19 08:48:04 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-12-19 08:48:23 -0500 |
commit | 784683a68dc3882f9507b9d304f4adf10fb403ae (patch) | |
tree | 7fa9d69db84f9a382bf5688adc5a007186e39a14 /modules/pseudoclients/memoserv.cpp | |
parent | 3b2094301d6cfb6ef4e17746c93a31f82d21a703 (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/memoserv.cpp')
-rw-r--r-- | modules/pseudoclients/memoserv.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/modules/pseudoclients/memoserv.cpp b/modules/pseudoclients/memoserv.cpp index ff8d11602..e1565ab67 100644 --- a/modules/pseudoclients/memoserv.cpp +++ b/modules/pseudoclients/memoserv.cpp @@ -165,19 +165,23 @@ class MemoServCore : public Module { this->SetAuthor("Anope"); - BotInfo *bi = BotInfo::Find(Config->MemoServ); - if (!bi) + MemoServ = BotInfo::Find(Config->MemoServ); + if (!MemoServ) throw ModuleException("No bot named " + Config->MemoServ); - Implementation i[] = { I_OnNickIdentify, I_OnJoinChannel, I_OnUserAway, I_OnNickUpdate, I_OnPreHelp, I_OnPostHelp }; + Implementation i[] = { I_OnBotDelete, I_OnNickIdentify, I_OnJoinChannel, I_OnUserAway, I_OnNickUpdate, I_OnPreHelp, I_OnPostHelp }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - - Service::AddAlias("BotInfo", "MemoServ", bi->nick); } ~MemoServCore() { - Service::DelAlias("BotInfo", "MemoServ"); + MemoServ = NULL; + } + + void OnBotDelete(BotInfo *bi) anope_override + { + if (bi == MemoServ) + MemoServ = NULL; } void OnNickIdentify(User *u) anope_override |