diff --git a/CMakeLists.txt b/CMakeLists.txt index 062efbf..932d526 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,4 +4,4 @@ AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/mod_achievements.cpp") AC_ADD_SCRIPT_LOADER("AccountAchievements" "${CMAKE_CURRENT_LIST_DIR}/src/loader_achievements.h") -CU_ADD_HOOK(AFTER_WORLDSERVER_CMAKE "${CMAKE_CURRENT_LIST_DIR}/src/cmake/after_ws_install.cmake") \ No newline at end of file +AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/mod_achievements.conf.dist") diff --git a/src/cmake/after_ws_install.cmake b/src/cmake/after_ws_install.cmake deleted file mode 100644 index f0712a2..0000000 --- a/src/cmake/after_ws_install.cmake +++ /dev/null @@ -1,15 +0,0 @@ -if( WIN32 ) - if ( MSVC ) - add_custom_command(TARGET worldserver - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_MOD_ACHIEVEMENTS_DIR}/conf/mod_achievements.conf.dist" ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/ - ) - elseif ( MINGW ) - add_custom_command(TARGET worldserver - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_MOD_ACHIEVEMENTS_DIR}/conf/mod_achievements.conf.dist" ${CMAKE_BINARY_DIR}/bin/ - ) - endif() -endif() - -install(FILES "${CMAKE_MOD_ACHIEVEMENTS_DIR}/conf/mod_achievements.conf.dist" DESTINATION ${CONF_DIR}) \ No newline at end of file diff --git a/src/mod_achievements.cpp b/src/mod_achievements.cpp index ce3d7ff..19154ff 100644 --- a/src/mod_achievements.cpp +++ b/src/mod_achievements.cpp @@ -85,29 +85,7 @@ public: } }; -class AccountAchievementsWorld : public WorldScript -{ -public: - AccountAchievementsWorld() : WorldScript("AccountAchievementsWorld") { } - - void OnBeforeConfigLoad(bool reload) override - { - if (!reload) { - std::string conf_path = _CONF_DIR; - std::string cfg_file = conf_path + "/mod_achievements.conf"; -#ifdef WIN32 - cfg_file = "mod_achievements.conf"; -#endif - std::string cfg_def_file = cfg_file + ".dist"; - sConfigMgr->LoadMore(cfg_def_file.c_str()); - - sConfigMgr->LoadMore(cfg_file.c_str()); - } - } -}; - void AddAccountAchievementsScripts() { - new AccountAchievementsWorld; new AccountAchievements; }