Fix mob punch sound not always played
This commit is contained in:
parent
55f5a54c29
commit
66485f09e5
|
@ -1340,19 +1340,11 @@ function mobs:register_mob(name, def)
|
||||||
hitter:set_wielded_item(weapon)
|
hitter:set_wielded_item(weapon)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- weapon sounds
|
-- punch sounds
|
||||||
if weapon:get_definition().sounds ~= nil then
|
minetest.sound_play("default_punch", {
|
||||||
local s = math.random(0, #weapon:get_definition().sounds)
|
object = hitter,
|
||||||
minetest.sound_play(weapon:get_definition().sounds[s], {
|
max_hear_distance = 5
|
||||||
object=hitter,
|
})
|
||||||
max_hear_distance = 8
|
|
||||||
})
|
|
||||||
else
|
|
||||||
minetest.sound_play("default_punch", {
|
|
||||||
object = hitter,
|
|
||||||
max_hear_distance = 5
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- exit here if dead
|
-- exit here if dead
|
||||||
if check_for_death(self, hitter) then
|
if check_for_death(self, hitter) then
|
||||||
|
|
Loading…
Reference in New Issue