From 8b0d195906b37bdc7ca3980ac915c61dafee4fa5 Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Sun, 5 Mar 2023 12:58:17 +0000 Subject: [PATCH] Fix broken setting This commit adds some lines of code which make sure that nothing gets destroyed when TNT griefing is disabled. --- mods/CORE/mcl_explosions/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index b67c7c6a2..90a2d2cca 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -13,6 +13,7 @@ under the LGPLv2.1 license. mcl_explosions = {} local mod_fire = minetest.get_modpath("mcl_fire") +local tnt_griefing = minetest.settings:get_bool("mcl_tnt_griefing", true) --local CONTENT_FIRE = minetest.get_content_id("mcl_fire:fire") local math = math @@ -359,7 +360,11 @@ local function trace_explode(pos, strength, raydirs, radius, info, direct, sourc for hash, idx in pairs(destroy) do local do_drop = math.random() <= drop_chance local on_blast = node_on_blast[data[idx]] - local remove = true + if (not tnt_griefing) and info.is_tnt ~= false then + local remove = false + else + local remove = true + end if do_drop or on_blast then local npos = get_position_from_hash(hash)