Furnace: Fix "output full" infotext
authorPaul Ouellette <oue.paul18@gmail.com>
Sun, 11 Aug 2019 14:28:02 +0000 (10:28 -0400)
committerSmallJoker <SmallJoker@users.noreply.github.com>
Sun, 11 Aug 2019 14:28:02 +0000 (16:28 +0200)
mods/default/furnace.lua

index a06f3b23d82bef47b928a223bb5b85b5cddbbd18..e045080a51c60e04c19509c589680d5d280b9bc1 100644 (file)
@@ -107,6 +107,7 @@ local function furnace_node_timer(pos, elapsed)
 
        local inv = meta:get_inventory()
        local srclist, fuellist
+       local dst_full = false
 
        local cookable, cooked
        local fuel
@@ -146,6 +147,8 @@ local function furnace_node_timer(pos, elapsed)
                                                inv:set_stack("src", 1, aftercooked.items[1])
                                                src_time = src_time - cooked.time
                                                update = true
+                                       else
+                                               dst_full = true
                                        end
                                else
                                        -- Item could not be cooked: probably missing fuel
@@ -195,7 +198,7 @@ local function furnace_node_timer(pos, elapsed)
        local item_percent = 0
        if cookable then
                item_percent = math.floor(src_time / cooked.time * 100)
-               if item_percent > 100 then
+               if dst_full then
                        item_state = "100% (output full)"
                else
                        item_state = item_percent .. "%"