forked from VoxeLibre/VoxeLibre
Fix mobs not making hit sound when hit by node
This commit is contained in:
parent
d5a38fef58
commit
c831da2c02
|
@ -184,20 +184,23 @@ mobs.mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
||||||
if damage >= 0.1 then
|
if damage >= 0.1 then
|
||||||
|
|
||||||
-- weapon sounds
|
-- weapon sounds
|
||||||
|
--this doesn't work right for nodes
|
||||||
|
--[[
|
||||||
if weapon:get_definition().sounds ~= nil then
|
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], {
|
minetest_sound_play(weapon:get_definition().sounds[s], {
|
||||||
object = self.object, --hitter,
|
object = self.object, --hitter,
|
||||||
max_hear_distance = 16
|
max_hear_distance = 16
|
||||||
}, true)
|
}, true)
|
||||||
else
|
else
|
||||||
|
]]--
|
||||||
minetest_sound_play("default_punch", {
|
minetest_sound_play("default_punch", {
|
||||||
object = self.object,
|
object = self.object,
|
||||||
max_hear_distance = 16
|
max_hear_distance = 16
|
||||||
}, true)
|
}, true)
|
||||||
end
|
--end
|
||||||
|
|
||||||
--damage_effect(self, damage)
|
--damage_effect(self, damage)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue