Skip to content

Commit

Permalink
Chainsaw: Chat message for 'aborted by safe cut'
Browse files Browse the repository at this point in the history
This provides a feedback to the player.
  • Loading branch information
SmallJoker committed Dec 7, 2024
1 parent b268e3d commit 59643c4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions technic/tools/chainsaw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 59643c4

Please sign in to comment.