aboutsummaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-01-09 21:15:35 +0100
committerGitHub <noreply@github.com>2022-01-09 21:15:35 +0100
commit4c8c6497799c83cb5bac773ac4eac7ea572ec78f (patch)
treeffa67ce9002a94f6354eedbc94a1b768ed0cd336 /src/settings.cpp
parentb164e16d1be30220029729d63a1e621395ad00ad (diff)
downloadminetest-4c8c6497799c83cb5bac773ac4eac7ea572ec78f.tar.gz
minetest-4c8c6497799c83cb5bac773ac4eac7ea572ec78f.tar.bz2
minetest-4c8c6497799c83cb5bac773ac4eac7ea572ec78f.zip
Mainmenu game-related changes (#11887)
fixes: * Switching between games does not immediately hide creative mode / damage buttons if so specified * World creation menu has a game selection list even though the menu already provides a gamebar * Showing gameid in world list is unnecessary * Choice of mapgen parameters in menu persists between games (and was half-broken)
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index cf7ec1b72..0e44ee0bc 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -659,9 +659,7 @@ bool Settings::getNoiseParamsFromGroup(const std::string &name,
bool Settings::exists(const std::string &name) const
{
- MutexAutoLock lock(m_mutex);
-
- if (m_settings.find(name) != m_settings.end())
+ if (existsLocal(name))
return true;
if (auto parent = getParent())
return parent->exists(name);
@@ -669,6 +667,14 @@ bool Settings::exists(const std::string &name) const
}
+bool Settings::existsLocal(const std::string &name) const
+{
+ MutexAutoLock lock(m_mutex);
+
+ return m_settings.find(name) != m_settings.end();
+}
+
+
std::vector<std::string> Settings::getNames() const
{
MutexAutoLock lock(m_mutex);