From 58faecb5d54d64ef1440f1097e934f6a714507f4 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Fri, 3 Jan 2014 10:15:30 -0800 Subject: [PATCH] - bugfix for datapath --- source/glest_game/main/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 4f6d6952..a3d2aca1 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -1316,7 +1316,9 @@ int setupGameItemPaths(int argc, char** argv, Config *config) { if(customPathValue != "") { endPathWithSlash(customPathValue); } - pathCache[GameConstants::path_data_CacheLookupKey]=customPathValue; + pathCache[GameConstants::path_data_CacheLookupKey] = customPathValue; + Properties::setApplicationDataPath(pathCache[GameConstants::path_data_CacheLookupKey]); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Using custom data path [%s]\n",customPathValue.c_str()); } else { @@ -1329,16 +1331,17 @@ int setupGameItemPaths(int argc, char** argv, Config *config) { else if(config != NULL) { if(config->getString("DataPath","") != "") { string customPathValue = config->getString("DataPath",""); + if(customPathValue != "") { endPathWithSlash(customPathValue); } pathCache[GameConstants::path_data_CacheLookupKey] = config->getString("DataPath",""); + Properties::setApplicationDataPath(pathCache[GameConstants::path_data_CacheLookupKey]); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Using ini specified data path [%s]\n",config->getString("DataPath","").c_str()); } } - Properties::setApplicationDataPath(pathCache[GameConstants::path_data_CacheLookupKey]); - //GAME_ARG_INI_PATH if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_INI_PATH]) == true) { int foundParamIndIndex = -1;