From 1899e5dc1ec2555ac88e20477a0341f3a96c0339 Mon Sep 17 00:00:00 2001 From: Jan-Peter Nilsson Date: Sun, 3 Apr 2011 19:37:53 +0200 Subject: [PATCH] If there is an openmw.cfg in the current path, use it as global config --- apps/openmw/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index f6f023592..7ba3fb4d6 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -73,7 +73,13 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine) 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::ifstream globalConfigFile(cfgFile.c_str());