From dfcf64c1d07f4006045af37b0b01dbfc82dbb1d1 Mon Sep 17 00:00:00 2001
From: SmallJoker <mk939@ymail.com>
Date: Sat, 26 Aug 2023 10:57:05 +0200
Subject: [PATCH] Chainsaw: new setting to disable safe cutting

---
 technic/tools/chainsaw.lua |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/technic/tools/chainsaw.lua b/technic/tools/chainsaw.lua
index 2e12614..d2ee966 100644
--- a/technic/tools/chainsaw.lua
+++ b/technic/tools/chainsaw.lua
@@ -116,6 +116,7 @@
 	-- 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 @@
 	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

--
Gitblit v1.8.0