Add max_hear_distance for fire
authorRui <Rui914@users.noreply.github.com>
Sat, 14 Mar 2015 04:30:25 +0000 (13:30 +0900)
committersfan5 <sfan5@live.de>
Sun, 29 Mar 2015 19:35:03 +0000 (21:35 +0200)
mods/fire/init.lua

index 5b0008f11f74887092854d3fb4d1d7c05b0dca8b..309c3988d591cee609818f1de32d598c4b8db100 100644 (file)
@@ -63,7 +63,7 @@ function fire.update_sounds_around(pos)
        if not sound then
                if should_have_sound then
                        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,
                        }
                end
@@ -74,7 +74,7 @@ function fire.update_sounds_around(pos)
                elseif sound.name ~= wanted_sound.name then
                        minetest.sound_stop(sound.handle)
                        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,
                        }
                end