Fast fix for #115: bad argument #1 to 'pairs' (table expected, got nil)

This commit is contained in:
Joachim Stolberg 2023-01-29 16:47:07 +01:00
parent 8bb62a4abc
commit 14f7c8718c

View File

@ -30,7 +30,7 @@ local TOTAL_MAX = INV_SIZE * FUEL_STACK_MAX
local function count_coal(metadata) local function count_coal(metadata)
local total = 0 local total = 0
for _,stack in pairs(metadata.inventory.fuel) do for _,stack in pairs(metadata.inventory.fuel or {}) do
total = total + stack:get_count() total = total + stack:get_count()
end end
return total return total