diff options
Diffstat (limited to 'modules/pseudoclients/global.cpp')
| -rw-r--r-- | modules/pseudoclients/global.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/pseudoclients/global.cpp b/modules/pseudoclients/global.cpp index a5e1eb573..3fca89039 100644 --- a/modules/pseudoclients/global.cpp +++ b/modules/pseudoclients/global.cpp @@ -53,12 +53,19 @@ class GlobalCore : public Module { this->SetAuthor("Anope"); - Global = BotInfo::Find(Config->Global); - if (!Global) + BotInfo *bi = BotInfo::Find(Config->Global); + if (!bi) throw ModuleException("No bot named " + Config->Global); Implementation i[] = { 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"); } void OnRestart() anope_override |
