summaryrefslogtreecommitdiff
path: root/src/guildmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-09 01:24:29 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-09 01:24:29 +0300
commit71dd90d37461d1882f0e4d45749ff458fd97a78c (patch)
tree07e3564ac590419118a252543be28d314bb080c5 /src/guildmanager.cpp
parente72f26151bca6c5a73d0377e385c0f7dd7cab3aa (diff)
downloadmv-71dd90d37461d1882f0e4d45749ff458fd97a78c.tar.gz
mv-71dd90d37461d1882f0e4d45749ff458fd97a78c.tar.bz2
mv-71dd90d37461d1882f0e4d45749ff458fd97a78c.tar.xz
mv-71dd90d37461d1882f0e4d45749ff458fd97a78c.zip
Fix guild manager initialisation if switching between servers.
Diffstat (limited to 'src/guildmanager.cpp')
-rw-r--r--src/guildmanager.cpp15
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()