fix config path

This commit is contained in:
Callow
2022-07-13 13:40:16 +03:00
parent 1621b47975
commit 4d16211b6c
3 changed files with 15 additions and 4 deletions

View File

@ -14,16 +14,17 @@
void Run(HMODULE* phModule)
{
ResourceLoader::SetModuleHandle(*phModule);
auto cheatDir = std::filesystem::path(util::GetModulePath(*phModule)).parent_path();
// Init config
std::string configPath = (std::filesystem::current_path() / "cfg.json").string();
config::Initialize(configPath);
config::Initialize((cheatDir / "cfg.json").string());
// Init logger
auto& settings = cheat::feature::Settings::GetInstance();
if (settings.f_FileLogging)
{
Logger::PrepareFileLogging((std::filesystem::current_path() / "logs").string());
Logger::PrepareFileLogging((cheatDir / "logs").string());
Logger::SetLevel(Logger::Level::Trace, Logger::LoggerType::FileLogger);
}
@ -55,5 +56,5 @@ void Run(HMODULE* phModule)
cheat::Init();
LOG_DEBUG("Config path is at %s", configPath.c_str());
LOG_DEBUG("Config path is at %s", (cheatDir / "cfg.json").string().c_str());
}