From: Perttu Ahola Date: Sat, 10 Mar 2012 22:53:39 +0000 (+0200) Subject: Fix configuration file behaviour X-Git-Tag: 0.4.dev-20120318~64 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b485fac33ef961fb5725f3ae34520ee3b2f0339b;p=oweals%2Fminetest.git Fix configuration file behaviour - Do not rewrite if nothing needs to be changed - Update at program exit, in addition to updating when continuing from main menu to game --- diff --git a/src/main.cpp b/src/main.cpp index 10e01be2a..83bca7c44 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1708,6 +1708,10 @@ int main(int argc, char *argv[]) #endif // !SERVER + // Update configuration file + if(configpath != "") + g_settings->updateConfigFile(configpath.c_str()); + END_DEBUG_EXCEPTION_HANDLER(errorstream) debugstreams_deinit(); diff --git a/src/settings.h b/src/settings.h index 4bc22eaa1..c08d54a47 100644 --- a/src/settings.h +++ b/src/settings.h @@ -172,7 +172,8 @@ public: */ bool getUpdatedConfigObject(std::istream &is, core::list &dst, - core::map &updated) + core::map &updated, + bool &value_changed) { JMutexAutoLock lock(m_mutex); @@ -219,6 +220,7 @@ public: infostream<<"Changing value of \""< \""<