summaryrefslogtreecommitdiff
path: root/src/guildmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-08-30 01:57:05 +0300
committerAndrei Karas <akaras@inbox.ru>2011-08-30 02:32:13 +0300
commit9f752d5431364c052b364045015d3574da2c320c (patch)
tree9278797f892129e42fde74656db032dc480c4490 /src/guildmanager.cpp
parent8158669fde4f4a32191d6b052586e7cf0889ab7e (diff)
downloadmanaplus-9f752d5431364c052b364045015d3574da2c320c.tar.gz
manaplus-9f752d5431364c052b364045015d3574da2c320c.tar.bz2
manaplus-9f752d5431364c052b364045015d3574da2c320c.tar.xz
manaplus-9f752d5431364c052b364045015d3574da2c320c.zip
Dont create guild manager instance if guild bot support not enabled.
Diffstat (limited to 'src/guildmanager.cpp')
-rw-r--r--src/guildmanager.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/guildmanager.cpp b/src/guildmanager.cpp
index 77324e67e..2c55caefa 100644
--- a/src/guildmanager.cpp
+++ b/src/guildmanager.cpp
@@ -38,9 +38,9 @@
#include "debug.h"
+bool GuildManager::mEnableGuildBot = false;
GuildManager::GuildManager() :
- mEnableGuildBot(false),
mGotInfo(false),
mGotName(false),
mHavePower(false),
@@ -57,6 +57,9 @@ GuildManager::~GuildManager()
void GuildManager::init()
{
+ if (guildManager)
+ return;
+
int val = serverConfig.getValue("enableGuildBot", -1);
if (val == -1)
{
@@ -67,6 +70,8 @@ void GuildManager::init()
serverConfig.setValue("enableGuildBot", val);
}
mEnableGuildBot = val;
+ if (mEnableGuildBot)
+ guildManager = new GuildManager();
}
void GuildManager::reload()