mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 22:15:32 +00:00
If there is an openmw.cfg in the current path, use it as global config
This commit is contained in:
parent
7c506301b7
commit
f2faa34bd9
1 changed files with 7 additions and 1 deletions
|
@ -59,7 +59,13 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine)
|
||||||
|
|
||||||
bpo::variables_map variables;
|
bpo::variables_map variables;
|
||||||
|
|
||||||
std::string cfgFile = OMW::Path::getPath(OMW::Path::GLOBAL_CFG_PATH, "openmw", "openmw.cfg");
|
//If there is an openmw.cfg in the current path use that as global config
|
||||||
|
//Otherwise try getPath
|
||||||
|
std::string cfgFile = "openmw.cfg";
|
||||||
|
if(!isFile(cfgFile.c_str()))
|
||||||
|
{
|
||||||
|
cfgFile = OMW::Path::getPath(OMW::Path::GLOBAL_CFG_PATH, "openmw", "openmw.cfg");
|
||||||
|
}
|
||||||
std::cout << "Using global config file: " << cfgFile << std::endl;
|
std::cout << "Using global config file: " << cfgFile << std::endl;
|
||||||
std::ifstream globalConfigFile(cfgFile.c_str());
|
std::ifstream globalConfigFile(cfgFile.c_str());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue