aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorLoïc Blot <loic.blot@unix-experience.fr>2017-03-29 15:50:22 +0200
committerLoïc Blot <loic.blot@unix-experience.fr>2017-03-29 15:50:22 +0200
commitfbc1432fe8e821f58e97a5f35340efb2f46f93e4 (patch)
tree4e38b5d752dfa04bd1f6053e47e202fd650c3e61 /src/script/lua_api
parentb605b95749aad90b53e6c58a1ee43b50f8217e7c (diff)
downloadminetest-fbc1432fe8e821f58e97a5f35340efb2f46f93e4.tar.gz
minetest-fbc1432fe8e821f58e97a5f35340efb2f46f93e4.tar.bz2
minetest-fbc1432fe8e821f58e97a5f35340efb2f46f93e4.zip
l_minimap: don't show minimap if configuration doesn't allow it
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_minimap.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/script/lua_api/l_minimap.cpp b/src/script/lua_api/l_minimap.cpp
index 8e03936a7..182894f4f 100644
--- a/src/script/lua_api/l_minimap.cpp
+++ b/src/script/lua_api/l_minimap.cpp
@@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "lua_api/l_internal.h"
#include "common/c_converter.h"
#include "minimap.h"
+#include "settings.h"
LuaMinimap::LuaMinimap(Minimap *m)
{
@@ -118,6 +119,10 @@ int LuaMinimap::l_toggle_shape(lua_State *L)
int LuaMinimap::l_show(lua_State *L)
{
+ // If minimap is disabled by config, don't show it.
+ if (!g_settings->getBool("enable_minimap"))
+ return 1;
+
Client *client = getClient(L);
assert(client);