mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-27 02:19:33 +01:00
Make tools without toolcaps do damage as hand
If the tool_capabilities defaults to {} if unspecified the tool, then users will not be able to attack with the tool at all. This solves that by including the damage_group and full_punch_interval from the hand into the tool_capabilities when it is nil.
This commit is contained in:
parent
fe770c19a5
commit
4c46eb2b4b
1 changed files with 8 additions and 1 deletions
|
@ -249,7 +249,14 @@ local function get_tool_capabilities(tdef)
|
|||
if tdef.tool_capabilities then
|
||||
return tdef.tool_capabilities
|
||||
end
|
||||
return {}
|
||||
|
||||
-- If the damage group and punch interval from hand is not included,
|
||||
-- then the user will not be able to attack with the tool.
|
||||
local hand_toolcaps = minetest.registered_tools[""].tool_capabilities
|
||||
return {
|
||||
full_punch_interval = hand_toolcaps.full_punch_interval,
|
||||
damage_groups = hand_toolcaps.damage_groups
|
||||
}
|
||||
end
|
||||
|
||||
-- Get the groupcaps for a tool. This function returns "groupcaps" table of
|
||||
|
|
Loading…
Reference in a new issue