Skip to content

Commit 59643c4

Browse files
committed
Chainsaw: Chat message for 'aborted by safe cut'
This provides a feedback to the player.
1 parent b268e3d commit 59643c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

technic/tools/chainsaw.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ local function dig_recursive(x, y, z)
128128
if safe_cut and cutter.param2[i] ~= 0 then
129129
-- Do not dig manually placed nodes
130130
-- Problem: moretrees' generated jungle trees use param2 = 2
131+
cutter.stopped_by_safe_cut = true
131132
return
132133
end
133134

@@ -201,6 +202,11 @@ local function chainsaw_dig(player, pos, remaining_charge)
201202
return
202203
end
203204

205+
if cutter.stopped_by_safe_cut then
206+
minetest.chat_send_player(player_name, S("The chainsaw could not dig all nodes" ..
207+
" because the safety mechanism was activated."))
208+
end
209+
204210
minetest.sound_play("chainsaw", {
205211
pos = pos,
206212
gain = 1.0,

0 commit comments

Comments
 (0)