summaryrefslogtreecommitdiff
path: root/modules/pseudoclients/global.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/global.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/global.cpp')
-rw-r--r--modules/pseudoclients/global.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/modules/pseudoclients/global.cpp b/modules/pseudoclients/global.cpp
index 3fca89039..228da91a5 100644
--- a/modules/pseudoclients/global.cpp
+++ b/modules/pseudoclients/global.cpp
@@ -53,19 +53,23 @@ class GlobalCore : public Module
{
this->SetAuthor("Anope");
- BotInfo *bi = BotInfo::Find(Config->Global);
- if (!bi)
+ Global = BotInfo::Find(Config->Global);
+ if (!Global)
throw ModuleException("No bot named " + Config->Global);
- Implementation i[] = { I_OnRestart, I_OnShutdown, I_OnNewServer, I_OnPreHelp };
+ Implementation i[] = { I_OnBotDelete, I_OnRestart, I_OnShutdown, I_OnNewServer, I_OnPreHelp };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
-
- Service::AddAlias("BotInfo", "Global", bi->nick);
}
~GlobalCore()
{
- Service::DelAlias("BotInfo", "Global");
+ Global = NULL;
+ }
+
+ void OnBotDelete(BotInfo *bi) anope_override
+ {
+ if (bi == Global)
+ Global = NULL;
}
void OnRestart() anope_override