From be5ac6c9e436533ba7106f7e12876c7ed3271b18 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 11 Mar 2011 23:48:16 +0000 Subject: [PATCH] - bugfix for g3d viewer to work with windows openwith --- source/g3d_viewer/main.cpp | 3 +++ source/glest_game/global/config.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/g3d_viewer/main.cpp b/source/g3d_viewer/main.cpp index bdd4527a..841b462c 100644 --- a/source/g3d_viewer/main.cpp +++ b/source/g3d_viewer/main.cpp @@ -2060,6 +2060,9 @@ int App::MainLoop(){ } int App::OnExit(){ + SystemFlags::Close(); + SystemFlags::SHUTDOWN_PROGRAM_MODE=true; + return 0; } diff --git a/source/glest_game/global/config.cpp b/source/glest_game/global/config.cpp index 59de6b07..3c353d22 100644 --- a/source/glest_game/global/config.cpp +++ b/source/glest_game/global/config.cpp @@ -97,6 +97,10 @@ Config::Config(std::pair type, std::pair f fileName.second = getGameReadWritePath(GameConstants::path_ini_CacheLookupKey) + fileName.second; } + if(fileMustExist.first == true && fileExists(fileName.first) == false) { + string currentpath = extractDirectoryPathFromFile(Properties::getApplicationPath()); + fileName.first = currentpath + fileName.first; + } //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] cfgFile.first = [%s]\n",__FILE__,__FUNCTION__,__LINE__,fileName.first.c_str()); if(SystemFlags::VERBOSE_MODE_ENABLED) printf("-=-=-=-=-=-=-= About to load fileName.first = [%s]\n",fileName.first.c_str()); @@ -118,7 +122,6 @@ Config::Config(std::pair type, std::pair f else if(properties.first.getString("UserOverrideFile", defaultNotFoundValue.c_str()) != defaultNotFoundValue) { fileName.second = properties.first.getString("UserOverrideFile") + fileNameParameter.second; } - } else if(cfgType.first == cfgMainKeys) { Config &mainCfg = Config::getInstance();