Chainsaw: new setting to disable safe cutting

Some trees might generate with param2 != 0, which makes the
chainsaw appear blunt/useless. This safety feature is now
customizable.
This commit is contained in:
SmallJoker
2023-08-26 10:57:03 +02:00
parent 0921c326a8
commit dfcf64c1d0
2 changed files with 11 additions and 1 deletions

View File

@ -116,6 +116,7 @@ local cutter = {
-- See function cut_tree()
}
local safe_cut = minetest.settings:get_bool("technic_safe_chainsaw") ~= false
local c_air = minetest.get_content_id("air")
local function dig_recursive(x, y, z)
local i = cutter.area:index(x, y, z)
@ -124,7 +125,7 @@ local function dig_recursive(x, y, z)
end
cutter.seen[i] = 1 -- Mark as visited
if cutter.param2[i] ~= 0 then
if safe_cut and cutter.param2[i] ~= 0 then
-- Do not dig manually placed nodes
-- Problem: moretrees' generated jungle trees use param2 = 2
return