Fix broken setting

This commit adds some lines of code which make sure that nothing gets destroyed when TNT griefing is disabled.
This commit is contained in:
FossFanatic 2023-03-05 12:58:17 +00:00 committed by Johannes Fritz
parent e15d0cd5a0
commit 8b0d195906
1 changed files with 6 additions and 1 deletions

View File

@ -13,6 +13,7 @@ under the LGPLv2.1 license.
mcl_explosions = {} mcl_explosions = {}
local mod_fire = minetest.get_modpath("mcl_fire") 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 CONTENT_FIRE = minetest.get_content_id("mcl_fire:fire")
local math = math 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 for hash, idx in pairs(destroy) do
local do_drop = math.random() <= drop_chance local do_drop = math.random() <= drop_chance
local on_blast = node_on_blast[data[idx]] 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 if do_drop or on_blast then
local npos = get_position_from_hash(hash) local npos = get_position_from_hash(hash)