From 3758a4ba9278fbdef576484c8a4350f6bd61d466 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Thu, 10 Mar 2011 18:54:40 +0000 Subject: [PATCH] - bugfix for missing userdtaa folder, needs to be created right away if missing (thanks KroArtem) --- source/glest_game/main/main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 18e88850..5dbcc67d 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -1596,6 +1596,17 @@ int glestMain(int argc, char** argv) { // Attempt to read ini files Config &config = Config::getInstance(); + string userData = config.getString("UserData_Root",""); + if(userData != "") { + if(userData != "" && EndsWith(userData, "/") == false && EndsWith(userData, "\\") == false) { + userData += "/"; + } + + if(isdir(userData.c_str()) == false) { + createDirectoryPaths(userData); + } + } + // Set some statics based on ini entries SystemFlags::ENABLE_THREADED_LOGGING = config.getBool("ThreadedLogging","true"); FontGl::setDefault_fontType(config.getString("DefaultFont",FontGl::getDefault_fontType().c_str())); @@ -1772,7 +1783,7 @@ int glestMain(int argc, char** argv) { gameInitialized = true; // Setup the screenshots folder - string userData = config.getString("UserData_Root",""); + //string userData = config.getString("UserData_Root",""); if(userData != "") { if(userData != "" && EndsWith(userData, "/") == false && EndsWith(userData, "\\") == false) { userData += "/";