diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index df7f57b..9122eb6 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -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(); -} \ No newline at end of file +}