Skip to content

Commit 1e46a2b

Browse files
committed
possible fixed minetest-mods#57 typo on entity on_punch
* related to https://codeberg.org/minenux/minetest-mod-3d_armor/issues/57 * related to minetest-mods#57
1 parent 66741e9 commit 1e46a2b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: 3d_armor/README.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Additional fields supported by 3d_armor:
9393
on_unequip = <function>
9494
on_destroy = <function>
9595
on_damage = <function>
96-
on_punched = <function>
96+
on_punch = <function>
9797

9898
armor:register_armor_group(group, base)
9999

@@ -166,11 +166,11 @@ on_equip = func(player, index, stack)
166166
on_unequip = func(player, index, stack)
167167
on_destroy = func(player, index, stack)
168168
on_damage = func(player, index, stack)
169-
on_punched = func(player, hitter, time_from_last_punch, tool_capabilities)
169+
on_punch = func(player, hitter, time_from_last_punch, tool_capabilities)
170170

171171
Notes:
172172

173-
`on_punched` is called every time a player is punched or takes damage, `hitter`,
173+
`on_punch` is called every time a player is punched or takes damage, `hitter`,
174174
`time_from_last_punch` and `tool_capabilities` can be `nil` and will be in the
175175
case of fall damage, etc. When fire protection is enabled, hitter == "fire"
176176
in the event of fire damage. Return `false` to override armor damage effects.

Diff for: 3d_armor/api.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabili
330330
local use = minetest.get_item_group(name, "armor_use") or 0
331331
local damage = use > 0
332332
local def = stack:get_definition() or {}
333-
if type(def.on_punched) == "function" then
334-
damage = def.on_punched(player, hitter, time_from_last_punch,
333+
if type(def.on_punch) == "function" then
334+
damage = def.on_punch(player, hitter, time_from_last_punch,
335335
tool_capabilities) ~= false and damage == true
336336
end
337337
if damage == true and tool_capabilities then

0 commit comments

Comments
 (0)