Skip to content

Commit

Permalink
fix faulty empty table check
Browse files Browse the repository at this point in the history
  • Loading branch information
SwissalpS committed Mar 5, 2024
1 parent 8274824 commit 021c4c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autocrafter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local S = minetest.get_translator("pipeworks")
local autocrafterCache = {}

local craft_time = 1
local next = next

local function count_index(invlist)
local index = {}
Expand Down Expand Up @@ -141,7 +142,7 @@ local function calculate_consumption(inv_index, consumption_with_groups)
end

-- Next, resolve groups using the remaining items in the inventory
if grouped_ingredients ~= {} then
if next(grouped_ingredients) ~= nil then
local take
for itemname, count in pairs(inv_index) do
if count > 0 then
Expand Down

0 comments on commit 021c4c3

Please sign in to comment.