From 59643c45d485e938296933e59665bc68caebab15 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sat, 7 Dec 2024 22:15:37 +0100 Subject: [PATCH] Chainsaw: Chat message for 'aborted by safe cut' This provides a feedback to the player. --- technic/tools/chainsaw.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/technic/tools/chainsaw.lua b/technic/tools/chainsaw.lua index ee8fed7..84afcba 100644 --- a/technic/tools/chainsaw.lua +++ b/technic/tools/chainsaw.lua @@ -128,6 +128,7 @@ local function dig_recursive(x, y, z) if safe_cut and cutter.param2[i] ~= 0 then -- Do not dig manually placed nodes -- Problem: moretrees' generated jungle trees use param2 = 2 + cutter.stopped_by_safe_cut = true return end @@ -201,6 +202,11 @@ local function chainsaw_dig(player, pos, remaining_charge) return end + if cutter.stopped_by_safe_cut then + minetest.chat_send_player(player_name, S("The chainsaw could not dig all nodes" .. + " because the safety mechanism was activated.")) + end + minetest.sound_play("chainsaw", { pos = pos, gain = 1.0,