X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fsettings.cpp;h=0e44ee0bcb6c9adbc7915d228843a8c5fd85298d;hb=e16a470d59069692d654f5c1529ab313a01ded67;hp=cf7ec1b721d0f351647e7778295db52400d677a9;hpb=ff934d538c00518476c31f5df6ebc4be5ca79591;p=minetest.git 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 Settings::getNames() const { MutexAutoLock lock(m_mutex);