Skip to content

Commit

Permalink
Merge branch 'fork-20240725-furnace-elapsed-sound' into fork-master
Browse files Browse the repository at this point in the history
  • Loading branch information
Emojigit committed Jul 25, 2024
2 parents 3c43a8d + 98d6bbe commit ba522c7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mods/default/furnace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ local function furnace_node_timer(pos, elapsed)
local fuel

local update = true
local items_smelt = 0
while elapsed > 0 and update do
update = false

Expand Down Expand Up @@ -171,9 +172,7 @@ local function furnace_node_timer(pos, elapsed)
else
dst_full = true
end
-- Play cooling sound
minetest.sound_play("default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.07}, true)
items_smelt = items_smelt + 1
else
-- Item could not be cooked: probably missing fuel
update = true
Expand Down Expand Up @@ -224,6 +223,11 @@ local function furnace_node_timer(pos, elapsed)
elapsed = elapsed - el
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
fuel_totaltime = fuel.time
end
Expand Down

0 comments on commit ba522c7

Please sign in to comment.