From 66485f09e5b95c6c699e9ec98e779efd776fc4b2 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 21 Sep 2019 17:22:41 +0200 Subject: [PATCH] Fix mob punch sound not always played --- mods/mobs/api.lua | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index fdac33c..5bacf46 100644 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -1340,19 +1340,11 @@ function mobs:register_mob(name, def) hitter:set_wielded_item(weapon) end - -- weapon sounds - if weapon:get_definition().sounds ~= nil then - local s = math.random(0, #weapon:get_definition().sounds) - minetest.sound_play(weapon:get_definition().sounds[s], { - object=hitter, - max_hear_distance = 8 - }) - else - minetest.sound_play("default_punch", { - object = hitter, - max_hear_distance = 5 - }) - end + -- punch sounds + minetest.sound_play("default_punch", { + object = hitter, + max_hear_distance = 5 + }) -- exit here if dead if check_for_death(self, hitter) then