]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/script/lua_api/l_minimap.cpp
Clang-format styles fixes since previous commit
[dragonfireclient.git] / src / script / lua_api / l_minimap.cpp
index 8e03936a751c15c706fe9f2780da4cb1e6e28fb5..c68602909e9ca0e70e6210194f19e922a8cfab41 100644 (file)
@@ -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);
 
@@ -196,7 +201,7 @@ void LuaMinimap::Register(lua_State *L)
 }
 
 const char LuaMinimap::className[] = "Minimap";
-const luaL_reg LuaMinimap::methods[] = {
+const luaL_Reg LuaMinimap::methods[] = {
        luamethod(LuaMinimap, show),
        luamethod(LuaMinimap, hide),
        luamethod(LuaMinimap, get_pos),