Add support for new damage sound

master
BlockMen 2013-06-15 22:18:48 +02:00
parent 97e83fdf64
commit e21836aede
3 changed files with 7 additions and 3 deletions

View File

@ -360,9 +360,6 @@ minetest.register_abm({
for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 15.1/16)) do--1.3
if object:get_hp() > 0 then
object:set_hp(object:get_hp()-1)
if object:is_player() then
if CACTUS_HURT_SOUND then minetest.sound_play("dplus_hurt", {pos = pos, gain = 0.5, max_hear_distance = 10}) end
end
elseif not object:is_player() and object:get_hp() == 0 and object:get_luaentity().name ~= "__builtin:item" then
object:remove()
end

View File

@ -330,6 +330,13 @@ minetest.register_node("default:cactus", {
fixed = {-7/16, -0.5, -7/16, 7/16, 0.5, 7/16},
},
on_punch = function(pos, node, puncher)
if not puncher then return end
if puncher:get_wielded_item():get_name() == "" then
minetest.sound_play("player_damage", {pos = pos, gain = 0.3, max_hear_distance = 10})
end
end,
})
minetest.register_node("default:papyrus", {