From 4139d145cfccdc9417dae190134aaa5c55b1fccf Mon Sep 17 00:00:00 2001 From: hiker Date: Wed, 26 Feb 2014 09:41:38 +1100 Subject: [PATCH] Create a default user config file if no user config file exists. This is for now useful for crash problems (e.g. to disable shaders). --- src/config/user_config.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/config/user_config.cpp b/src/config/user_config.cpp index a2e4db058..3838b915e 100644 --- a/src/config/user_config.cpp +++ b/src/config/user_config.cpp @@ -738,8 +738,13 @@ bool UserConfig::loadConfig() XMLNode* root = file_manager->createXMLTree(filename); if(!root || root->getName() != "stkconfig") { - std::cerr << "Could not read user config file file " << filename << std::endl; + Log::error("UserConfig", + "Could not read user config file '%s'.", filename.c_str()); if(root) delete root; + // Create a default config file - just in case that stk crashes later + // there is a config file that can be modified (to e.g. disable + // shaders) + saveConfig(); return false; }