forked from Wuzzy/realtest_mt5
Fix furnace/bonfire burn sound playing when igniting without fuel
This commit is contained in:
parent
55e2d56bd2
commit
fe41a9b2cd
|
@ -147,10 +147,6 @@ minetest.register_abm({
|
||||||
end
|
end
|
||||||
|
|
||||||
if meta:get_int("active") == 1 then
|
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 inv = meta:get_inventory()
|
||||||
|
|
||||||
local srclist = inv:get_list("src")
|
local srclist = inv:get_list("src")
|
||||||
|
@ -187,6 +183,10 @@ minetest.register_abm({
|
||||||
meta:get_float("fuel_totaltime") * 100)
|
meta:get_float("fuel_totaltime") * 100)
|
||||||
meta:set_string("infotext","Bonfire active: "..percent.."%")
|
meta:set_string("infotext","Bonfire active: "..percent.."%")
|
||||||
hacky_swap_node(pos,"bonfire:self_active")
|
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",
|
meta:set_string("formspec",
|
||||||
"size[8,9]"..
|
"size[8,9]"..
|
||||||
"image[2,2;1,1;default_furnace_fire_bg.png^[lowpart:"..
|
"image[2,2;1,1;default_furnace_fire_bg.png^[lowpart:"..
|
||||||
|
|
|
@ -212,10 +212,6 @@ minetest.register_abm({
|
||||||
end
|
end
|
||||||
|
|
||||||
if meta:get_int("active") == 1 then
|
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 srclists = {}
|
||||||
local cookeds = {}
|
local cookeds = {}
|
||||||
for i = 1,5 do
|
for i = 1,5 do
|
||||||
|
@ -255,6 +251,10 @@ minetest.register_abm({
|
||||||
meta:get_float("fuel_totaltime") * 100)
|
meta:get_float("fuel_totaltime") * 100)
|
||||||
meta:set_string("infotext","Furnace active: "..percent.."%")
|
meta:set_string("infotext","Furnace active: "..percent.."%")
|
||||||
hacky_swap_node(pos,"furnace:self_active")
|
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",
|
meta:set_string("formspec",
|
||||||
"size[8,8]"..
|
"size[8,8]"..
|
||||||
"size[8,8]"..
|
"size[8,8]"..
|
||||||
|
|
Loading…
Reference in New Issue