Add max_hear_distance for fire

This commit is contained in:
Rui 2015-03-14 13:30:25 +09:00 committed by sfan5
parent 525f467057
commit 9c15ebccab
1 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ function fire.update_sounds_around(pos)
if not sound then if not sound then
if should_have_sound then if should_have_sound then
fire.sounds[p0_hash] = { fire.sounds[p0_hash] = {
handle = minetest.sound_play(wanted_sound, {pos=cp, loop=true}), handle = minetest.sound_play(wanted_sound, {pos=cp, max_hear_distance = 16, loop=true}),
name = wanted_sound.name, name = wanted_sound.name,
} }
end end
@ -74,7 +74,7 @@ function fire.update_sounds_around(pos)
elseif sound.name ~= wanted_sound.name then elseif sound.name ~= wanted_sound.name then
minetest.sound_stop(sound.handle) minetest.sound_stop(sound.handle)
fire.sounds[p0_hash] = { fire.sounds[p0_hash] = {
handle = minetest.sound_play(wanted_sound, {pos=cp, loop=true}), handle = minetest.sound_play(wanted_sound, {pos=cp, max_hear_distance = 16, loop=true}),
name = wanted_sound.name, name = wanted_sound.name,
} }
end end