From c831da2c02253450df965930cbfcd539b820f3b9 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Fri, 23 Apr 2021 16:22:34 -0400 Subject: [PATCH] Fix mobs not making hit sound when hit by node --- .../mcl_mobs/api/mob_functions/interaction.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua index 2cd9335e04..264eff9de8 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua @@ -184,20 +184,23 @@ mobs.mob_punch = function(self, hitter, tflp, tool_capabilities, dir) if damage >= 0.1 then -- weapon sounds + --this doesn't work right for nodes + --[[ if weapon:get_definition().sounds ~= nil then - local s = math_random(0, #weapon:get_definition().sounds) + local s = math_random(1, #weapon:get_definition().sounds) minetest_sound_play(weapon:get_definition().sounds[s], { object = self.object, --hitter, max_hear_distance = 16 }, true) else - minetest_sound_play("default_punch", { - object = self.object, - max_hear_distance = 16 - }, true) - end + ]]-- + minetest_sound_play("default_punch", { + object = self.object, + max_hear_distance = 16 + }, true) + --end --damage_effect(self, damage)