From 4e1f50035e860a00636ca5d804c267119df99601 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Sun, 11 Aug 2013 04:09:45 +0200 Subject: Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu --- src/main.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index f495a6ba2..7450593d3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -84,6 +84,7 @@ with this program; if not, write to the Free Software Foundation, Inc., */ Settings main_settings; Settings *g_settings = &main_settings; +std::string g_settings_path; // Global profiler Profiler main_profiler; @@ -913,7 +914,7 @@ int main(int argc, char *argv[]) */ // Path of configuration file in use - std::string configpath = ""; + g_settings_path = ""; if(cmd_args.exists("config")) { @@ -924,7 +925,7 @@ int main(int argc, char *argv[]) <readConfigFile(filenames[i].c_str()); if(r) { - configpath = filenames[i]; + g_settings_path = filenames[i]; break; } } // If no path found, use the first one (menu creates the file) - if(configpath == "") - configpath = filenames[0]; + if(g_settings_path == "") + g_settings_path = filenames[0]; } // Initialize debug streams @@ -1193,7 +1194,7 @@ int main(int argc, char *argv[]) verbosestream<<_("Using gameid")<<" ["<run() == false || kill == true) { - g_settings->updateConfigFile(configpath.c_str()); + if(g_settings_path != "") { + g_settings->updateConfigFile( + g_settings_path.c_str()); + } break; } @@ -1694,7 +1703,6 @@ int main(int argc, char *argv[]) current_address, current_port, error_message, - configpath, chat_backend, gamespec, simple_singleplayer_mode @@ -1749,8 +1757,8 @@ int main(int argc, char *argv[]) #endif // !SERVER // Update configuration file - if(configpath != "") - g_settings->updateConfigFile(configpath.c_str()); + if(g_settings_path != "") + g_settings->updateConfigFile(g_settings_path.c_str()); // Print modified quicktune values { -- cgit v1.2.3