diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-09 01:24:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-09 01:24:29 +0300 |
commit | 71dd90d37461d1882f0e4d45749ff458fd97a78c (patch) | |
tree | 07e3564ac590419118a252543be28d314bb080c5 | |
parent | e72f26151bca6c5a73d0377e385c0f7dd7cab3aa (diff) | |
download | manaplus-71dd90d37461d1882f0e4d45749ff458fd97a78c.tar.gz manaplus-71dd90d37461d1882f0e4d45749ff458fd97a78c.tar.bz2 manaplus-71dd90d37461d1882f0e4d45749ff458fd97a78c.tar.xz manaplus-71dd90d37461d1882f0e4d45749ff458fd97a78c.zip |
Fix guild manager initialisation if switching between servers.
-rw-r--r-- | src/guildmanager.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/guildmanager.cpp b/src/guildmanager.cpp index 7bc0444ed..eaee529b9 100644 --- a/src/guildmanager.cpp +++ b/src/guildmanager.cpp @@ -57,9 +57,6 @@ GuildManager::~GuildManager() void GuildManager::init() { - if (guildManager) - return; - int val = serverConfig.getValue("enableGuildBot", -1); if (val == -1) { @@ -71,7 +68,17 @@ void GuildManager::init() } mEnableGuildBot = val; if (mEnableGuildBot) - guildManager = new GuildManager(); + { + if (!guildManager) + guildManager = new GuildManager(); + else + guildManager->reload(); + } + else if (guildManager) + { + delete guildManager; + guildManager = 0; + } } void GuildManager::reload() |