diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-03-02 11:51:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-03-02 11:51:08 +0300 |
commit | 1d168f911b1d09a8086977fa574bda71984aac88 (patch) | |
tree | 2077e3d1f978d5a5143ef4a47e34fad53f33a1cb /src/guildmanager.cpp | |
parent | 1911170833f19d8639adc27772aa5246d7438b6f (diff) | |
download | plus-1d168f911b1d09a8086977fa574bda71984aac88.tar.gz plus-1d168f911b1d09a8086977fa574bda71984aac88.tar.bz2 plus-1d168f911b1d09a8086977fa574bda71984aac88.tar.xz plus-1d168f911b1d09a8086977fa574bda71984aac88.zip |
Dont try enable guild bot if server have native guilds.
Diffstat (limited to 'src/guildmanager.cpp')
-rw-r--r-- | src/guildmanager.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/guildmanager.cpp b/src/guildmanager.cpp index 0e9999977..f3fee9f44 100644 --- a/src/guildmanager.cpp +++ b/src/guildmanager.cpp @@ -37,6 +37,7 @@ #include "net/chathandler.h" #include "net/packetlimiter.h" +#include "net/serverfeatures.h" #include "utils/delete2.h" #include "utils/timer.h" @@ -72,16 +73,23 @@ GuildManager::~GuildManager() void GuildManager::init() { - int val = serverConfig.getValue("enableGuildBot", -1); - if (val == -1) + if (serverFeatures->haveNativeGuilds()) { - if (client->isTmw()) - val = 1; - else - val = 0; - serverConfig.setValue("enableGuildBot", val); + mEnableGuildBot = false; + } + else + { + int val = serverConfig.getValue("enableGuildBot", -1); + if (val == -1) + { + if (client->isTmw()) + val = 1; + else + val = 0; + serverConfig.setValue("enableGuildBot", val); + } + mEnableGuildBot = val; } - mEnableGuildBot = val; if (mEnableGuildBot) { if (!guildManager) |