From 3faf38ae6cee04e8f2051ecef6d4000ca7e8d677 Mon Sep 17 00:00:00 2001 From: Kargatum Date: Tue, 14 Jan 2020 15:58:33 +0700 Subject: [PATCH] fix(Config): del useless loading config (#29) --- CMakeLists.txt | 5 +++++ src/transmog_scripts.cpp | 16 +--------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c11c71..b6ee2b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,10 @@ + +# Add cpp files AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/transmog_scripts.cpp") AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/Transmogrification.cpp") + +# Add scripts to script loader AC_ADD_SCRIPT_LOADER("Transmog" "${CMAKE_CURRENT_LIST_DIR}/src/transmog_scripts_loader.h" "SC_Npc_VisualWeapon") +# Add config file AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/transmog.conf.dist") diff --git a/src/transmog_scripts.cpp b/src/transmog_scripts.cpp index 39973c5..49aa7d1 100644 --- a/src/transmog_scripts.cpp +++ b/src/transmog_scripts.cpp @@ -436,8 +436,7 @@ public: void OnAfterConfigLoad(bool reload) override { - if (reload) - sT->LoadConfig(reload); + sT->LoadConfig(reload); } void OnStartup() override @@ -452,19 +451,6 @@ public: CharacterDatabase.Execute("DELETE FROM `custom_transmogrification_sets` WHERE NOT EXISTS(SELECT 1 FROM characters WHERE characters.guid = custom_transmogrification_sets.Owner)"); #endif } - - void OnBeforeConfigLoad(bool reload) override - { - if (!reload) { - std::string conf_path = _CONF_DIR; - std::string cfg_file = conf_path + "/transmog.conf"; - std::string cfg_def_file = cfg_file +".dist"; - - sConfigMgr->LoadMore(cfg_def_file.c_str()); - - sConfigMgr->LoadMore(cfg_file.c_str()); - } - } }; class global_transmog_script : public GlobalScript {