Skip to content

Commit

Permalink
Fix a crash: mobs accessing hitter (#1884)
Browse files Browse the repository at this point in the history
  • Loading branch information
Doloment authored Dec 31, 2024
1 parent d5aa411 commit f987527
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mods/_various/mobs/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1882,7 +1882,10 @@ function mobs:mob_punch(self, hitter, tflp, tool_capabilities, dir)
end

-- weapon wear
local weapon = hitter:get_wielded_item() or ItemStack("lord_archery:apple_wood_bow")
local weapon = ItemStack("lord_archery:apple_wood_bow")
if hitter:is_player() then
weapon = hitter:get_wielded_item()
end
local punch_interval = 1.4

-- calculate mob damage
Expand Down

0 comments on commit f987527

Please sign in to comment.