Skip to content

Commit

Permalink
l_minimap: don't show minimap if configuration doesn't allow it
Browse files Browse the repository at this point in the history
  • Loading branch information
nerzhul committed Mar 29, 2017
1 parent b605b95 commit fbc1432
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/script/lua_api/l_minimap.cpp
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit fbc1432

Please sign in to comment.