Merge pull request #2 from azerothcore/BarbzYHOOL-fix-config

CONFIG - Fixed for Linux
This commit is contained in:
Barbz 2018-04-30 17:31:33 +02:00 committed by GitHub
commit 6de8866088
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -262,7 +262,29 @@ public:
}
};
class CongratsOnLevelWorld : public WorldScript
{
public:
CongratsOnLevelWorld() : WorldScript("CongratsOnLevelWorld") { }
void OnBeforeConfigLoad(bool reload) override
{
if (!reload) {
std::string conf_path = _CONF_DIR;
std::string cfg_file = conf_path + "/mod_congratsonlevel.conf";
#ifdef WIN32
cfg_file = "mod_congratsonlevel.conf";
#endif
std::string cfg_def_file = cfg_file + ".dist";
sConfigMgr->LoadMore(cfg_def_file.c_str());
sConfigMgr->LoadMore(cfg_file.c_str());
}
}
};
void AddCongratsOnLevelScripts()
{
new CongratsOnLevelWorld();
new CongratsOnLevel();
}