mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 15:00:18 +01:00
Limit furnace sound volume on catch-up smelting (#3144)
This commit is contained in:
parent
da0509c5bd
commit
77bbcee0cd
@ -134,6 +134,7 @@ local function furnace_node_timer(pos, elapsed)
|
|||||||
local fuel
|
local fuel
|
||||||
|
|
||||||
local update = true
|
local update = true
|
||||||
|
local items_smelt = 0
|
||||||
while elapsed > 0 and update do
|
while elapsed > 0 and update do
|
||||||
update = false
|
update = false
|
||||||
|
|
||||||
@ -171,9 +172,7 @@ local function furnace_node_timer(pos, elapsed)
|
|||||||
else
|
else
|
||||||
dst_full = true
|
dst_full = true
|
||||||
end
|
end
|
||||||
-- Play cooling sound
|
items_smelt = items_smelt + 1
|
||||||
minetest.sound_play("default_cool_lava",
|
|
||||||
{pos = pos, max_hear_distance = 16, gain = 0.07}, true)
|
|
||||||
else
|
else
|
||||||
-- Item could not be cooked: probably missing fuel
|
-- Item could not be cooked: probably missing fuel
|
||||||
update = true
|
update = true
|
||||||
@ -224,6 +223,11 @@ local function furnace_node_timer(pos, elapsed)
|
|||||||
elapsed = elapsed - el
|
elapsed = elapsed - el
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if items_smelt > 0 then
|
||||||
|
-- Play cooling sound
|
||||||
|
minetest.sound_play("default_cool_lava",
|
||||||
|
{ pos = pos, max_hear_distance = 16, gain = 0.07 * math.min(items_smelt, 7) }, true)
|
||||||
|
end
|
||||||
if fuel and fuel_totaltime > fuel.time then
|
if fuel and fuel_totaltime > fuel.time then
|
||||||
fuel_totaltime = fuel.time
|
fuel_totaltime = fuel.time
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user