fix(Config): del useless loading config (#29)

This commit is contained in:
Kargatum
2020-01-14 15:58:33 +07:00
committed by GitHub
parent 8e9dde4e6e
commit 3faf38ae6c
2 changed files with 6 additions and 15 deletions

View File

@@ -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/transmog_scripts.cpp")
AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/Transmogrification.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") 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") AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/transmog.conf.dist")

View File

@@ -436,7 +436,6 @@ public:
void OnAfterConfigLoad(bool reload) override void OnAfterConfigLoad(bool reload) override
{ {
if (reload)
sT->LoadConfig(reload); sT->LoadConfig(reload);
} }
@@ -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)"); CharacterDatabase.Execute("DELETE FROM `custom_transmogrification_sets` WHERE NOT EXISTS(SELECT 1 FROM characters WHERE characters.guid = custom_transmogrification_sets.Owner)");
#endif #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 { class global_transmog_script : public GlobalScript {