Fix rake taking credit for hand-digging nodes.

When you have a thing in your hand that doesn't help
you dig a node, but you can dig that node by hand,
then apparently the after_use callback still seems to
trigger, causing the rake effect, and wear-out.
This commit is contained in:
Aaron Suen 2019-10-31 21:33:53 -04:00
parent 11f2dce038
commit 6f3bb30825
2 changed files with 4 additions and 3 deletions

View File

@ -17,7 +17,9 @@ minetest.register_tool(modname .. ":rake", {
snappy = 1,
}),
sounds = nodecore.sounds("nc_tree_sticky"),
after_use = function(stack, user, _, digparams)
after_use = function(stack, user, node, digparams)
local def = node and node.name and minetest.registered_nodes[node.name]
if not (def and def.groups and def.groups.snappy) then return end
local pname = user and user:is_player() and user:get_player_name()
if pname then raked[pname] = digparams end
stack:add_wear(wearrate)

View File

@ -82,8 +82,7 @@ for i = 1, #glyphs do
buildable_to = true,
pointable = false,
groups = {
alpha_glyph = 1,
snappy = 1
alpha_glyph = 1
},
drop = coallump,
floodable = true