CONFIG - Fixed
The config should now be read and the module working.
This commit is contained in:
parent
7bc0035bf0
commit
d03efd02d1
1 changed files with 23 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue