Fix furnace/bonfire burn sound playing when igniting without fuel

This commit is contained in:
Wuzzy 2020-04-05 06:40:06 +02:00
parent 55e2d56bd2
commit fe41a9b2cd
2 changed files with 8 additions and 8 deletions

View File

@ -147,10 +147,6 @@ minetest.register_abm({
end
if meta:get_int("active") == 1 then
if meta:get_int("sound_play") ~= 1 then
meta:set_int("sound_handle", minetest.sound_play("bonfire_burning", {pos=pos, max_hear_distance = 4,loop=true,gain=0.8}))
meta:set_int("sound_play", 1)
end
local inv = meta:get_inventory()
local srclist = inv:get_list("src")
@ -187,6 +183,10 @@ minetest.register_abm({
meta:get_float("fuel_totaltime") * 100)
meta:set_string("infotext","Bonfire active: "..percent.."%")
hacky_swap_node(pos,"bonfire:self_active")
if meta:get_int("sound_play") ~= 1 then
meta:set_int("sound_handle", minetest.sound_play("bonfire_burning", {pos=pos, max_hear_distance = 4,loop=true,gain=0.8}))
meta:set_int("sound_play", 1)
end
meta:set_string("formspec",
"size[8,9]"..
"image[2,2;1,1;default_furnace_fire_bg.png^[lowpart:"..

View File

@ -212,10 +212,6 @@ minetest.register_abm({
end
if meta:get_int("active") == 1 then
if meta:get_int("sound_play") ~= 1 then
meta:set_int("sound_handle", minetest.sound_play("furnace_burning", {pos=pos, max_hear_distance = 8,loop=true}))
meta:set_int("sound_play", 1)
end
local srclists = {}
local cookeds = {}
for i = 1,5 do
@ -255,6 +251,10 @@ minetest.register_abm({
meta:get_float("fuel_totaltime") * 100)
meta:set_string("infotext","Furnace active: "..percent.."%")
hacky_swap_node(pos,"furnace:self_active")
if meta:get_int("sound_play") ~= 1 then
meta:set_int("sound_handle", minetest.sound_play("furnace_burning", {pos=pos, max_hear_distance = 8,loop=true}))
meta:set_int("sound_play", 1)
end
meta:set_string("formspec",
"size[8,8]"..
"size[8,8]"..