From 44ca9c9cb2079fa97068adb8ee894c5ae13a9975 Mon Sep 17 00:00:00 2001 From: nerzhul Date: Mon, 13 Mar 2017 15:55:30 +0100 Subject: [CSM] Add enable_client_modding param (default: false) --- src/client.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index 049616c63..4ddabd814 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -248,7 +248,8 @@ Client::Client( m_recommended_send_interval(0.1), m_removed_sounds_check_timer(0), m_state(LC_Created), - m_localdb(NULL) + m_localdb(NULL), + m_script(NULL) { // Add local player m_env.setLocalPlayer(new LocalPlayer(this, playername)); @@ -262,6 +263,7 @@ Client::Client( g_settings->getBool("enable_bumpmapping") || g_settings->getBool("enable_parallax_occlusion")); + m_modding_enabled = g_settings->getBool("enable_client_modding"); m_script = new ClientScripting(this); m_env.setScript(m_script); } @@ -270,6 +272,11 @@ void Client::initMods() { m_script->loadMod(getBuiltinLuaPath() + DIR_DELIM "init.lua", BUILTIN_MOD_NAME); + // If modding is not enabled, don't load mods, just builtin + if (!m_modding_enabled) { + return; + } + ClientModConfiguration modconf(getClientModsLuaPath()); std::vector mods = modconf.getMods(); std::vector unsatisfied_mods = modconf.getUnsatisfiedMods(); @@ -327,6 +334,7 @@ const ModSpec* Client::getModSpec(const std::string &modname) const void Client::Stop() { + // Don't disable this part when modding is disabled, it's used in builtin m_script->on_shutdown(); //request all client managed threads to stop m_mesh_update_thread.stop(); -- cgit v1.2.3