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:
parent
11f2dce038
commit
6f3bb30825
@ -17,7 +17,9 @@ minetest.register_tool(modname .. ":rake", {
|
|||||||
snappy = 1,
|
snappy = 1,
|
||||||
}),
|
}),
|
||||||
sounds = nodecore.sounds("nc_tree_sticky"),
|
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()
|
local pname = user and user:is_player() and user:get_player_name()
|
||||||
if pname then raked[pname] = digparams end
|
if pname then raked[pname] = digparams end
|
||||||
stack:add_wear(wearrate)
|
stack:add_wear(wearrate)
|
||||||
|
@ -82,8 +82,7 @@ for i = 1, #glyphs do
|
|||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
pointable = false,
|
pointable = false,
|
||||||
groups = {
|
groups = {
|
||||||
alpha_glyph = 1,
|
alpha_glyph = 1
|
||||||
snappy = 1
|
|
||||||
},
|
},
|
||||||
drop = coallump,
|
drop = coallump,
|
||||||
floodable = true
|
floodable = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user